

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Adam Ginsburg’s Python Code (agpy) &mdash; agpy 0.1.2 documentation</title>
    
    <link rel="stylesheet" href="_static/extra.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.1.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="agpy 0.1.2 documentation" href="index.html" />
    <link rel="next" title="Image Tools" href="image_tools.html" />
    <link rel="prev" title="AGPY Contents:" href="index.html" />
     
    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setDomainName', 'pyspeckit.bitbucket.org']);
      _gaq.push(['_setAllowHash', false]);
      _gaq.push(['_trackPageview']);


    </script>
    <link rel="stylesheet" type="text/css" href="_static/extra.css" />
  </head>
  <body>
    <div class="header-wrapper">
      <div class="header">
        <h1><a href="index.html">agpy 0.1.2 documentation</a></h1>
        <div class="rel">
          <a href="http://agpy.googlecode.com">agpy Home </a>  |
          <a href=index.html>Docs Home </a>  |
          <a href="http://code.google.com/p/agpy/w/list">Wiki</a>  |
          <a href=search.html>Search </a>
        </div>
       </div>
    </div>

    <div class="content-wrapper">
      <div class="content">
        <div class="document">
            
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="adam-ginsburg-s-python-code-agpy">
<h1>Adam Ginsburg&#8217;s Python Code (agpy)<a class="headerlink" href="#adam-ginsburg-s-python-code-agpy" title="Permalink to this headline">¶</a></h1>
<hr class="docutils" />
<div class="section" id="agpy-package">
<h2><a class="reference internal" href="#module-agpy" title="agpy"><tt class="xref py py-mod docutils literal"><span class="pre">agpy</span></tt></a> Package<a class="headerlink" href="#agpy-package" title="Permalink to this headline">¶</a></h2>
<span class="target" id="module-agpy"></span><p>The functions included below are the &#8216;mature&#8217; codes from the agpy package.</p>
<dl class="function">
<dt id="agpy.readcol">
<tt class="descclassname">agpy.</tt><tt class="descname">readcol</tt><big>(</big><em>filename</em>, <em>skipline=0</em>, <em>skipafter=0</em>, <em>names=False</em>, <em>fsep=None</em>, <em>twod=True</em>, <em>fixedformat=None</em>, <em>asdict=False</em>, <em>comment='#'</em>, <em>verbose=True</em>, <em>nullval=None</em>, <em>asStruct=False</em>, <em>namecomment=True</em>, <em>removeblanks=False</em>, <em>header_badchars=None</em><big>)</big><a class="headerlink" href="#agpy.readcol" title="Permalink to this definition">¶</a></dt>
<dd><p>The default return is a two dimensional float array.  If you want a list of
columns output instead of a 2D array, pass &#8216;twod=False&#8217;.  In this case,
each column&#8217;s data type will be automatically detected.</p>
<p>Example usage:
CASE 1) a table has the format:</p>
<blockquote>
<div>X    Y    Z</div></blockquote>
<p>0.0  2.4  8.2
1.0  3.4  5.6
0.7  3.2  2.1
...
names,(x,y,z)=readcol(&#8220;myfile.tbl&#8221;,names=True,twod=False)
or
x,y,z=readcol(&#8220;myfile.tbl&#8221;,skipline=1,twod=False)
or 
names,xx = readcol(&#8220;myfile.tbl&#8221;,names=True)
or
xxdict = readcol(&#8220;myfile.tbl&#8221;,asdict=True)
or
xxstruct = readcol(&#8220;myfile.tbl&#8221;,asStruct=True)</p>
<p>CASE 2) no title is contained into the table, then there is
no need to skipline:
x,y,z=readcol(&#8220;myfile.tbl&#8221;)</p>
<dl class="docutils">
<dt>CASE 3) there is a names column and then more descriptive text:</dt>
<dd>X      Y     Z</dd>
</dl>
<p>(deg) (deg) (km/s) 
0.0    2.4   8.2
1.0    3.4.  5.6
...
then use:
names,x,y,z=readcol(&#8220;myfile.tbl&#8221;,names=True,skipline=1,twod=False)
or
x,y,z=readcol(&#8220;myfile.tbl&#8221;,skipline=2,twod=False)</p>
<dl class="docutils">
<dt>INPUTS:</dt>
<dd><p class="first">fsep - field separator, e.g. for comma separated value (csv) files
skipline - number of lines to ignore at the start of the file
names - read / don&#8217;t read in the first line as a list of column names</p>
<blockquote>
<div>can specify an integer line number too, though it will be 
the line number after skipping lines</div></blockquote>
<p>twod - two dimensional or one dimensional output
nullval - if specified, all instances of this value will be replaced</p>
<blockquote>
<div>with a floating NaN</div></blockquote>
<dl class="last docutils">
<dt>asdict - zips names with data to create a dict with column headings </dt>
<dd>tied to column data.  If asdict=True, names will be set to True</dd>
<dt>asStruct - same as asdict, but returns a structure instead of a dictionary</dt>
<dd>(i.e. you call struct.key instead of struct[&#8216;key&#8217;])</dd>
<dt>fixedformat - if you have a fixed format file, this is a python list of </dt>
<dd>column lengths.  e.g. the first table above would be [3,5,5].  Note
that if you specify the wrong fixed format, you will get junk; if your
format total is greater than the line length, the last entries will all
be blank but readcol will not report an error.</dd>
<dt>namecomment - assumed that &#8220;Name&#8221; row is on a comment line.  If it is not - </dt>
<dd>e.g., it is the first non-comment line, change this to False</dd>
<dt>removeblanks - remove all blank entries from split lines.  This can cause lost</dt>
<dd>data if you have blank entries on some lines.</dd>
<dt>header_badchars - remove these characters from a header before parsing it</dt>
<dd>(helpful for IPAC tables that are delimited with | )</dd>
</dl>
</dd>
</dl>
<p>If you get this error: &#8220;scipy could not be imported.  Your table must have
full rows.&#8221; it means readcol cannot automatically guess which columns
contain data.  If you have scipy and columns of varying length, readcol will
read in all of the rows with length=mode(row lengths).</p>
</dd></dl>

<dl class="function">
<dt id="agpy.kdist">
<tt class="descclassname">agpy.</tt><tt class="descname">kdist</tt><big>(</big><em>l</em>, <em>b</em>, <em>vin</em>, <em>near=True</em>, <em>r0=8400.0</em>, <em>v0=254.0</em>, <em>dynamical=False</em>, <em>kinematic=True</em>, <em>regular=False</em>, <em>rrgal=False</em>, <em>verbose=False</em>, <em>inverse=False</em>, <em>silent=False</em>, <em>returnvtan=False</em><big>)</big><a class="headerlink" href="#agpy.kdist" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>NAME:</dt>
<dd>KINDIST</dd>
<dt>PURPOSE:</dt>
<dd>To return the distance to an object given l,b,v</dd>
<dt>CALLING SEQUENCE:</dt>
<dd>dist = KDIST (L, B, V)</dd>
<dt>INPUTS:</dt>
<dd>L, B &#8211; Galactic Longitude and Latitude (decimal degrees)
V - Velocity w.r.t. LSR in km/s</dd>
<dt>KEYWORD PARAMETERS:</dt>
<dd><dl class="first docutils">
<dt>/NEAR, /FAR &#8211; Report the near/far kinematic distances for Q1 and</dt>
<dd>Q4 data.</dd>
<dt>RO, VO &#8211; Force values for galactocentric distance for sun and</dt>
<dd>velocity of the LSR around the GC.  Default to 8.4 kpc
and 254 km/s (Reid et al., 2009)</dd>
</dl>
<p>RGAL &#8211; Named keyword containing galactocentric radius of sources.
rrgal  - return galactocentric distance in addition to distance from us
/DYNAMICAL &#8211; Use the dynamical definition of the LSR
/KINEMATIC &#8211; Use the kinematic definition of the LSR (default)
/REGULAR &#8211; Do not apply the rotation correction for High mass</p>
<blockquote class="last">
<div><blockquote>
<div>star forming regions.</div></blockquote>
<dl class="docutils">
<dt>INVERSE &#8211; If set, pass DISTANCE instead of velocity, and output is</dt>
<dd>velocity</dd>
<dt>returnvtan - if set, return the tanent velocity and ignore the input</dt>
<dd>velocity</dd>
</dl>
</div></blockquote>
</dd>
<dt>OUTPUTS:</dt>
<dd>DIST &#8211; the kinematic distance in units of R0 (defaults to pc).</dd>
</dl>
<p>MODIFICATION HISTORY:</p>
<blockquote>
<div><dl class="docutils">
<dt>Fri Feb 27 00:47:18 2009, Erik &lt;<a class="reference external" href="mailto:eros&#37;&#52;&#48;orthanc&#46;local">eros<span>&#64;</span>orthanc<span>&#46;</span>local</a>&gt;</dt>
<dd>Adapted from kindist.pro
Translated from IDL to Python by Adam Ginsburg (<a class="reference external" href="mailto:adam&#46;ginsburg&#37;&#52;&#48;colorado&#46;edu">adam<span>&#46;</span>ginsburg<span>&#64;</span>colorado<span>&#46;</span>edu</a>)</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="agpy.posang">
<tt class="descclassname">agpy.</tt><tt class="descname">posang</tt><big>(</big><em>l1</em>, <em>b1</em>, <em>l2</em>, <em>b2</em>, <em>system='galactic'</em>, <em>units='degrees'</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#agpy.posang" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the position angle between two points assuming a rectilinear
coordinate system (I think; at the very least I am making no corrections
for wcs).</p>
<p>INPUT:
longitude1, latitude1, longitude2, latitude2</p>
<p>Defaults to GALACTIC coordinates.  <a href="#id1"><span class="problematic" id="id2">**</span></a>kwargs are passed to coords.Position</p>
</dd></dl>

<dl class="function">
<dt id="agpy.downsample">
<tt class="descclassname">agpy.</tt><tt class="descname">downsample</tt><big>(</big><em>myarr</em>, <em>factor</em>, <em>estimator=&lt;function nanmean at 0x10bbca410&gt;</em><big>)</big><a class="headerlink" href="#agpy.downsample" title="Permalink to this definition">¶</a></dt>
<dd><p>Downsample a 2D array by averaging over <em>factor</em> pixels in each axis.
Crops upper edge if the shape is not a multiple of factor.</p>
<p>This code is pure numpy and should be fast.</p>
<dl class="docutils">
<dt>keywords:</dt>
<dd><dl class="first last docutils">
<dt>estimator - default to mean.  You can downsample by summing or</dt>
<dd>something else if you want a different estimator
(e.g., downsampling error: you want to sum &amp; divide by sqrt(n))</dd>
</dl>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.correlate2d">
<tt class="descclassname">agpy.</tt><tt class="descname">correlate2d</tt><big>(</big><em>im1</em>, <em>im2</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#agpy.correlate2d" title="Permalink to this definition">¶</a></dt>
<dd><p>Cross-correlation of two images of arbitrary size.  Returns an image
cropped to the largest of each dimension of the input images</p>
<p>Options:
return_fft - if true, return fft(im1)*fft(im2[::-1,::-1]), which is the power</p>
<blockquote>
<div>spectral density</div></blockquote>
<dl class="docutils">
<dt>fftshift - if true, return the shifted psd so that the DC component is in</dt>
<dd>the center of the image</dd>
</dl>
<p>pad - Default on.  Zero-pad image to the nearest 2^n
crop - Default on.  Return an image of the size of the largest input image.</p>
<blockquote>
<div>If the images are asymmetric in opposite directions, will return the largest 
image in both directions.</div></blockquote>
<p>WARNING: Normalization may be arbitrary if you use the PSD</p>
</dd></dl>

<dl class="function">
<dt id="agpy.convolve">
<tt class="descclassname">agpy.</tt><tt class="descname">convolve</tt><big>(</big><em>array</em>, <em>kernel</em>, <em>crop=True</em>, <em>return_fft=False</em>, <em>fftshift=True</em>, <em>fft_pad=True</em>, <em>psf_pad=False</em>, <em>ignore_nan=False</em>, <em>quiet=False</em>, <em>ignore_edge_zeros=True</em>, <em>min_wt=1e-08</em>, <em>force_ignore_zeros_off=False</em>, <em>normalize_kernel=&lt;function sum at 0x10317acf8&gt;</em>, <em>use_numpy_fft=False</em>, <em>nthreads=1</em><big>)</big><a class="headerlink" href="#agpy.convolve" title="Permalink to this definition">¶</a></dt>
<dd><p>Convolve an ndarray with an nd-kernel.  Returns a convolved image with shape =
array.shape.  Assumes image &amp; kernel are centered.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>array: `numpy.ndarray`</strong> :</p>
<blockquote>
<div><p>Array to be convolved with <em>kernel</em></p>
</div></blockquote>
<p><strong>kernel: `numpy.ndarray`</strong> :</p>
<blockquote>
<div><p>Will be normalized if <em>normalize_kernel</em> is set.  Assumed to be
centered (i.e., shifts may result if your kernel is asymmetric)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>default: *array* convolved with *kernel*</strong> :</p>
<p><strong>if return_fft: fft(*array*) * fft(*kernel*)</strong> :</p>
<blockquote>
<div><ul class="simple">
<li>if fftshift: Determines whether the fft will be shifted before
returning</li>
</ul>
</div></blockquote>
<p><strong>if *crop* == False</strong> : Returns the image, but with the fft-padded size</p>
<blockquote>
<div><p>instead of the input size</p>
</div></blockquote>
<p class="last"><strong>.. note: This is also implemented in :astropy:nddata:</strong> :</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt>
<tt class="descclassname">agpy.</tt><tt class="descname">convolve</tt><big>(</big><em>array</em>, <em>kernel</em>, <em>crop=True</em>, <em>return_fft=False</em>, <em>fftshift=True</em>, <em>fft_pad=True</em>, <em>psf_pad=False</em>, <em>ignore_nan=False</em>, <em>quiet=False</em>, <em>ignore_edge_zeros=True</em>, <em>min_wt=1e-08</em>, <em>force_ignore_zeros_off=False</em>, <em>normalize_kernel=&lt;function sum at 0x10317acf8&gt;</em>, <em>use_numpy_fft=False</em>, <em>nthreads=1</em><big>)</big></dt>
<dd><p>Convolve an ndarray with an nd-kernel.  Returns a convolved image with shape =
array.shape.  Assumes image &amp; kernel are centered.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>array: `numpy.ndarray`</strong> :</p>
<blockquote>
<div><p>Array to be convolved with <em>kernel</em></p>
</div></blockquote>
<p><strong>kernel: `numpy.ndarray`</strong> :</p>
<blockquote>
<div><p>Will be normalized if <em>normalize_kernel</em> is set.  Assumed to be
centered (i.e., shifts may result if your kernel is asymmetric)</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first"><strong>default: *array* convolved with *kernel*</strong> :</p>
<p><strong>if return_fft: fft(*array*) * fft(*kernel*)</strong> :</p>
<blockquote>
<div><ul class="simple">
<li>if fftshift: Determines whether the fft will be shifted before
returning</li>
</ul>
</div></blockquote>
<p><strong>if *crop* == False</strong> : Returns the image, but with the fft-padded size</p>
<blockquote>
<div><p>instead of the input size</p>
</div></blockquote>
<p class="last"><strong>.. note: This is also implemented in :astropy:nddata:</strong> :</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="agpy.smooth">
<tt class="descclassname">agpy.</tt><tt class="descname">smooth</tt><big>(</big><em>image</em>, <em>kernelwidth=3</em>, <em>kerneltype='gaussian'</em>, <em>trapslope=None</em>, <em>silent=True</em>, <em>psf_pad=True</em>, <em>interp_nan=False</em>, <em>nwidths='max'</em>, <em>min_nwidths=6</em>, <em>return_kernel=False</em>, <em>normalize_kernel=&lt;function sum at 0x10317acf8&gt;</em>, <em>downsample=False</em>, <em>downsample_factor=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#agpy.smooth" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a smoothed image using a gaussian, boxcar, or tophat kernel</p>
<p>Options: 
kernelwidth:</p>
<blockquote>
<div>width of kernel in pixels  (see definitions below)</div></blockquote>
<dl class="docutils">
<dt>kerneltype:</dt>
<dd><p class="first">gaussian, boxcar, or tophat.  
For a gaussian, uses a gaussian with sigma = kernelwidth (in pixels)</p>
<blockquote>
<div>out to [nwidths]-sigma</div></blockquote>
<p class="last">A boxcar is a kernelwidth x kernelwidth square 
A tophat is a flat circle with radius = kernelwidth</p>
</dd>
<dt>Default options:</dt>
<dd><dl class="first last docutils">
<dt>psf_pad: [True]</dt>
<dd>will pad the input image to be the image size + PSF.
Slows things down but removes edge-wrapping effects (see convolve)
This option should be set to false if the edges of your image are
symmetric.</dd>
<dt>interp_nan: [False]</dt>
<dd>Will replace NaN points in an image with the
smoothed average of its neighbors (you can still simply ignore NaN 
values by setting ignore_nan=True but leaving interp_nan=False)</dd>
<dt>silent: [True]</dt>
<dd>turn it off to get verbose statements about kernel types</dd>
<dt>return_kernel: [False]</dt>
<dd>If set to true, will return the kernel as the
second return value</dd>
<dt>nwidths: [&#8216;max&#8217;]</dt>
<dd>number of kernel widths wide to make the kernel.  Set to &#8216;max&#8217; to
match the image shape, otherwise use any integer</dd>
<dt>min_nwidths: [6]</dt>
<dd>minimum number of gaussian widths to make the kernel
(the kernel will be larger than the image if the image size is &lt;
min_widths*kernelsize)</dd>
<dt>normalize_kernel:</dt>
<dd>Should the kernel preserve the map sum (i.e. kernel.sum() = 1)
or the kernel peak (i.e. kernel.max() = 1) ?  Must be a <em>function</em> that can
operate on a numpy array</dd>
<dt>downsample:</dt>
<dd>downsample after smoothing?</dd>
<dt>downsample_factor:</dt>
<dd>if None, default to kernelwidth</dd>
</dl>
</dd>
</dl>
<p>Note that the kernel is forced to be even sized on each axis to assure no
offset when smoothing.</p>
</dd></dl>

<dl class="function">
<dt id="agpy.azimuthalAverage">
<tt class="descclassname">agpy.</tt><tt class="descname">azimuthalAverage</tt><big>(</big><em>image</em>, <em>center=None</em>, <em>stddev=False</em>, <em>returnradii=False</em>, <em>return_nr=False</em>, <em>binsize=0.5</em>, <em>weights=None</em>, <em>steps=False</em>, <em>interpnan=False</em>, <em>left=None</em>, <em>right=None</em>, <em>mask=None</em><big>)</big><a class="headerlink" href="#agpy.azimuthalAverage" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the azimuthally averaged radial profile.</p>
<p>image - The 2D image
center - The [x,y] pixel coordinates used as the center. The default is</p>
<blockquote>
<div>None, which then uses the center of the image (including 
fractional pixels).</div></blockquote>
<p>stddev - if specified, return the azimuthal standard deviation instead of the average
returnradii - if specified, return (radii_array,radial_profile)
return_nr   - if specified, return number of pixels per radius <em>and</em> radius
binsize - size of the averaging bin.  Can lead to strange results if</p>
<blockquote>
<div>non-binsize factors are used to specify the center and the binsize is
too large</div></blockquote>
<dl class="docutils">
<dt>weights - can do a weighted average instead of a simple average if this keyword parameter</dt>
<dd>is set.  weights.shape must = image.shape.  weighted stddev is undefined, so don&#8217;t
set weights and stddev.</dd>
<dt>steps - if specified, will return a double-length bin array and radial</dt>
<dd>profile so you can plot a step-form radial profile (which more accurately
represents what&#8217;s going on)</dd>
<dt>interpnan - Interpolate over NAN values, i.e. bins where there is no data?</dt>
<dd>left,right - passed to interpnan; they set the extrapolated values</dd>
<dt>mask - can supply a mask (boolean array same size as image with True for OK and False for not)</dt>
<dd>to average over only select data.</dd>
</dl>
<p>If a bin contains NO DATA, it will have a NAN value because of the
divide-by-sum-of-weights component.  I think this is a useful way to denote
lack of data, but users let me know if an alternative is prefered...</p>
</dd></dl>

<dl class="function">
<dt id="agpy.azimuthalAverageBins">
<tt class="descclassname">agpy.</tt><tt class="descname">azimuthalAverageBins</tt><big>(</big><em>image</em>, <em>azbins</em>, <em>symmetric=None</em>, <em>center=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#agpy.azimuthalAverageBins" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the azimuthal average over a limited range of angles 
kwargs are passed to azimuthalAverage</p>
</dd></dl>

<dl class="function">
<dt>
<tt class="descclassname">agpy.</tt><tt class="descname">kdist</tt><big>(</big><em>l</em>, <em>b</em>, <em>vin</em>, <em>near=True</em>, <em>r0=8400.0</em>, <em>v0=254.0</em>, <em>dynamical=False</em>, <em>kinematic=True</em>, <em>regular=False</em>, <em>rrgal=False</em>, <em>verbose=False</em>, <em>inverse=False</em>, <em>silent=False</em>, <em>returnvtan=False</em><big>)</big></dt>
<dd><dl class="docutils">
<dt>NAME:</dt>
<dd>KINDIST</dd>
<dt>PURPOSE:</dt>
<dd>To return the distance to an object given l,b,v</dd>
<dt>CALLING SEQUENCE:</dt>
<dd>dist = KDIST (L, B, V)</dd>
<dt>INPUTS:</dt>
<dd>L, B &#8211; Galactic Longitude and Latitude (decimal degrees)
V - Velocity w.r.t. LSR in km/s</dd>
<dt>KEYWORD PARAMETERS:</dt>
<dd><dl class="first docutils">
<dt>/NEAR, /FAR &#8211; Report the near/far kinematic distances for Q1 and</dt>
<dd>Q4 data.</dd>
<dt>RO, VO &#8211; Force values for galactocentric distance for sun and</dt>
<dd>velocity of the LSR around the GC.  Default to 8.4 kpc
and 254 km/s (Reid et al., 2009)</dd>
</dl>
<p>RGAL &#8211; Named keyword containing galactocentric radius of sources.
rrgal  - return galactocentric distance in addition to distance from us
/DYNAMICAL &#8211; Use the dynamical definition of the LSR
/KINEMATIC &#8211; Use the kinematic definition of the LSR (default)
/REGULAR &#8211; Do not apply the rotation correction for High mass</p>
<blockquote class="last">
<div><blockquote>
<div>star forming regions.</div></blockquote>
<dl class="docutils">
<dt>INVERSE &#8211; If set, pass DISTANCE instead of velocity, and output is</dt>
<dd>velocity</dd>
<dt>returnvtan - if set, return the tanent velocity and ignore the input</dt>
<dd>velocity</dd>
</dl>
</div></blockquote>
</dd>
<dt>OUTPUTS:</dt>
<dd>DIST &#8211; the kinematic distance in units of R0 (defaults to pc).</dd>
</dl>
<p>MODIFICATION HISTORY:</p>
<blockquote>
<div><dl class="docutils">
<dt>Fri Feb 27 00:47:18 2009, Erik &lt;<a class="reference external" href="mailto:eros&#37;&#52;&#48;orthanc&#46;local">eros<span>&#64;</span>orthanc<span>&#46;</span>local</a>&gt;</dt>
<dd>Adapted from kindist.pro
Translated from IDL to Python by Adam Ginsburg (<a class="reference external" href="mailto:adam&#46;ginsburg&#37;&#52;&#48;colorado&#46;edu">adam<span>&#46;</span>ginsburg<span>&#64;</span>colorado<span>&#46;</span>edu</a>)</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="agpy.vector_kdist">
<tt class="descclassname">agpy.</tt><tt class="descname">vector_kdist</tt><big>(</big><em>x</em>, <em>y</em>, <em>z</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#agpy.vector_kdist" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.moments">
<tt class="descclassname">agpy.</tt><tt class="descname">moments</tt><big>(</big><em>data</em>, <em>circle</em>, <em>rotate</em>, <em>vheight</em>, <em>estimator=&lt;function median at 0x1037f9488&gt;</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#agpy.moments" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns (height, amplitude, x, y, width_x, width_y, rotation angle)
the gaussian parameters of a 2D distribution by calculating its
moments.  Depending on the input parameters, will only output 
a subset of the above.</p>
<p>If using masked arrays, pass estimator=numpy.ma.median</p>
</dd></dl>

<dl class="function">
<dt id="agpy.twodgaussian">
<tt class="descclassname">agpy.</tt><tt class="descname">twodgaussian</tt><big>(</big><em>inpars</em>, <em>circle=False</em>, <em>rotate=True</em>, <em>vheight=True</em>, <em>shape=None</em><big>)</big><a class="headerlink" href="#agpy.twodgaussian" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a 2d gaussian function of the form:
x&#8217; = numpy.cos(rota) * x - numpy.sin(rota) * y
y&#8217; = numpy.sin(rota) * x + numpy.cos(rota) * y
(rota should be in degrees)
g = b + a * numpy.exp ( - ( ((x-center_x)/width_x)**2 +
((y-center_y)/width_y)**2 ) / 2 )</p>
<dl class="docutils">
<dt>inpars = [b,a,center_x,center_y,width_x,width_y,rota]</dt>
<dd>(b is background height, a is peak amplitude)</dd>
</dl>
<p>where x and y are the input parameters of the returned function,
and all other parameters are specified by this function</p>
<p>However, the above values are passed by list.  The list should be:
inpars = (height,amplitude,center_x,center_y,width_x,width_y,rota)</p>
<dl class="docutils">
<dt>You can choose to ignore / neglect some of the above input parameters </dt>
<dd><p class="first">unumpy.sing the following options:
circle=0 - default is an elliptical gaussian (different x, y</p>
<blockquote>
<div>widths), but can reduce the input by one parameter if it&#8217;s a
circular gaussian</div></blockquote>
<dl class="last docutils">
<dt>rotate=1 - default allows rotation of the gaussian ellipse.  Can</dt>
<dd>remove last parameter by setting rotate=0</dd>
<dt>vheight=1 - default allows a variable height-above-zero, i.e. an</dt>
<dd>additive constant for the Gaussian function.  Can remove first
parameter by setting this to 0</dd>
<dt>shape=None - if shape is set (to a 2-parameter list) then returns</dt>
<dd>an image with the gaussian defined by inpars</dd>
</dl>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfit">
<tt class="descclassname">agpy.</tt><tt class="descname">gaussfit</tt><big>(</big><em>data, err=None, params=(), autoderiv=True, return_all=False, circle=False, fixed=array([False, False, False, False, False, False, False], dtype=bool), limitedmin=[False, False, False, False, True, True, True], limitedmax=[False, False, False, False, False, False, True], usemoment=array([], dtype=bool), minpars=array([0, 0, 0, 0, 0, 0, 0]), maxpars=[0, 0, 0, 0, 0, 0, 360], rotate=1, vheight=1, quiet=True, returnmp=False, returnfitimage=False, **kwargs</em><big>)</big><a class="headerlink" href="#agpy.gaussfit" title="Permalink to this definition">¶</a></dt>
<dd><p>Gaussian fitter with the ability to fit a variety of different forms of
2-dimensional gaussian.</p>
<dl class="docutils">
<dt>Input Parameters:</dt>
<dd><p class="first">data - 2-dimensional data array
err=None - error array with same size as data array
params=[] - initial input parameters for Gaussian function.</p>
<blockquote>
<div>(height, amplitude, x, y, width_x, width_y, rota)
if not input, these will be determined from the moments of the system, 
assuming no rotation</div></blockquote>
<dl class="docutils">
<dt>autoderiv=1 - use the autoderiv provided in the lmder.f function (the</dt>
<dd>alternative is to us an analytic derivative with lmdif.f: this method
is less robust)</dd>
<dt>return_all=0 - Default is to return only the Gaussian parameters.  </dt>
<dd>1 - fit params, fit error</dd>
</dl>
<p>returnfitimage - returns (best fit params,best fit image)
returnmp - returns the full mpfit struct
circle=0 - default is an elliptical gaussian (different x, y widths),</p>
<blockquote>
<div>but can reduce the input by one parameter if it&#8217;s a circular gaussian</div></blockquote>
<dl class="last docutils">
<dt>rotate=1 - default allows rotation of the gaussian ellipse.  Can remove</dt>
<dd>last parameter by setting rotate=0.  numpy.expects angle in DEGREES</dd>
<dt>vheight=1 - default allows a variable height-above-zero, i.e. an</dt>
<dd>additive constant for the Gaussian function.  Can remove first
parameter by setting this to 0</dd>
<dt>usemoment - can choose which parameters to use a moment estimation for.</dt>
<dd>Other parameters will be taken from params.  Needs to be a boolean
array.</dd>
</dl>
</dd>
<dt>Output:</dt>
<dd><dl class="first docutils">
<dt>Default output is a set of Gaussian parameters with the same shape as</dt>
<dd>the input parameters</dd>
<dt>Can also output the covariance matrix, &#8216;infodict&#8217; that contains a lot</dt>
<dd>more detail about the fit (see scipy.optimize.leastsq), and a message
from leastsq telling what the exit status of the fitting routine was</dd>
</dl>
<p class="last">Warning: Does NOT necessarily output a rotation angle between 0 and 360 degrees.</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.onedgaussian">
<tt class="descclassname">agpy.</tt><tt class="descname">onedgaussian</tt><big>(</big><em>x</em>, <em>H</em>, <em>A</em>, <em>dx</em>, <em>w</em><big>)</big><a class="headerlink" href="#agpy.onedgaussian" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a 1-dimensional gaussian of form
H+A*numpy.exp(-(x-dx)**2/(2*w**2))</p>
</dd></dl>

<dl class="function">
<dt id="agpy.onedgaussfit">
<tt class="descclassname">agpy.</tt><tt class="descname">onedgaussfit</tt><big>(</big><em>xax, data, err=None, params=[0, 1, 0, 1], fixed=[False, False, False, False], limitedmin=[False, False, False, True], limitedmax=[False, False, False, False], minpars=[0, 0, 0, 0], maxpars=[0, 0, 0, 0], quiet=True, shh=True, veryverbose=False, vheight=True, negamp=False, usemoments=False</em><big>)</big><a class="headerlink" href="#agpy.onedgaussfit" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Inputs:</dt>
<dd><p class="first">xax - x axis
data - y axis
err - error corresponding to data</p>
<p class="last">params - Fit parameters: Height of background, Amplitude, Shift, Width
fixed - Is parameter fixed?
limitedmin/minpars - set lower limits on each parameter (default: width&gt;0)
limitedmax/maxpars - set upper limits on each parameter
quiet - should MPFIT output each iteration?
shh - output final parameters?
usemoments - replace default parameters with moments</p>
</dd>
<dt>Returns:</dt>
<dd>Fit parameters
Model
Fit errors
chi2</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-agpy.PCA_tools">
<span id="pca-tools-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">PCA_tools</span></tt> Module<a class="headerlink" href="#module-agpy.PCA_tools" title="Permalink to this headline">¶</a></h2>
<p>A set of tools for PCA analysis, singular value decomposition,
total least squares, and other linear fitting methods.</p>
<p>Running this code independently tests the fitting functions with different
types of random data.</p>
<dl class="function">
<dt id="agpy.PCA_tools.PCA_linear_fit">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">PCA_linear_fit</tt><big>(</big><em>data1</em>, <em>data2</em>, <em>print_results=False</em>, <em>ignore_nans=True</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#PCA_linear_fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.PCA_linear_fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Use principal component analysis to determine the best linear fit to the data.
data1 - x array
data2 - y array</p>
<p>returns m,b in the equation y = m x + b</p>
<p>print tells you some information about what fraction of the variance is accounted for</p>
<p>ignore_nans will remove NAN values from BOTH arrays before computing</p>
<p>Although this works well for the tests below, it fails horrifically on some
rather well-behaved data sets.  I don&#8217;t understand why this is, but that&#8217;s
why I wrote the total_least_squares SVD code below.</p>
</dd></dl>

<dl class="function">
<dt id="agpy.PCA_tools.efuncs">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">efuncs</tt><big>(</big><em>arr</em>, <em>return_others=False</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#efuncs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.efuncs" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine eigenfunctions of an array for use with
PCA cleaning</p>
</dd></dl>

<dl class="function">
<dt id="agpy.PCA_tools.pca_subtract">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">pca_subtract</tt><big>(</big><em>arr</em>, <em>ncomps</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#pca_subtract"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.pca_subtract" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the eigenfunctions and values of correlated data, then subtract off
the <em>ncomps</em> most correlated components, transform back to the original
space, and return that.</p>
</dd></dl>

<dl class="function">
<dt id="agpy.PCA_tools.pymc_linear_fit">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">pymc_linear_fit</tt><big>(</big><em>data1</em>, <em>data2</em>, <em>print_results=False</em>, <em>intercept=True</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#pymc_linear_fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.pymc_linear_fit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.PCA_tools.smooth_waterfall">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">smooth_waterfall</tt><big>(</big><em>arr</em>, <em>fwhm=4.0</em>, <em>unsharp=False</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#smooth_waterfall"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.smooth_waterfall" title="Permalink to this definition">¶</a></dt>
<dd><p>Smooth a waterfall plot.</p>
<p>If unsharp set, remove the smoothed component</p>
<p>Input array should have dimensions [timelen, nbolos]</p>
</dd></dl>

<dl class="function">
<dt id="agpy.PCA_tools.total_least_squares">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">total_least_squares</tt><big>(</big><em>data1</em>, <em>data2</em>, <em>print_results=False</em>, <em>ignore_nans=True</em>, <em>intercept=True</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#total_least_squares"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.total_least_squares" title="Permalink to this definition">¶</a></dt>
<dd><p>Use Singular Value Decomposition to determine the Total Least Squares linear fit to the data.
(e.g. <a class="reference external" href="http://en.wikipedia.org/wiki/Total_least_squares">http://en.wikipedia.org/wiki/Total_least_squares</a>)
data1 - x array
data2 - y array</p>
<dl class="docutils">
<dt>if intercept:</dt>
<dd>returns m,b in the equation y = m x + b</dd>
<dt>else:</dt>
<dd>returns m</dd>
</dl>
<p>print tells you some information about what fraction of the variance is accounted for</p>
<p>ignore_nans will remove NAN values from BOTH arrays before computing</p>
</dd></dl>

<dl class="function">
<dt id="agpy.PCA_tools.unpca_subtract">
<tt class="descclassname">agpy.PCA_tools.</tt><tt class="descname">unpca_subtract</tt><big>(</big><em>arr</em>, <em>ncomps</em><big>)</big><a class="reference internal" href="_modules/agpy/PCA_tools.html#unpca_subtract"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.PCA_tools.unpca_subtract" title="Permalink to this definition">¶</a></dt>
<dd><p>Like pca_subtract, except <tt class="xref py py-obj docutils literal"><span class="pre">keep</span></tt> the <em>ncomps</em> most correlated components
and reject the others</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.asinh_norm">
<span id="asinh-norm-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">asinh_norm</span></tt> Module<a class="headerlink" href="#module-agpy.asinh_norm" title="Permalink to this headline">¶</a></h2>
<div class="section" id="arcsinh-colorbar-normalization">
<h3>Arcsinh Colorbar Normalization<a class="headerlink" href="#arcsinh-colorbar-normalization" title="Permalink to this headline">¶</a></h3>
<p>For use with, e.g., imshow - 
imshow(myimage, norm=AsinhNorm())</p>
<p>Some of the ideas used are from <a class="reference external" href="aplpy.github.com">aplpy</a></p>
<dl class="class">
<dt id="agpy.asinh_norm.AsinhNorm">
<em class="property">class </em><tt class="descclassname">agpy.asinh_norm.</tt><tt class="descname">AsinhNorm</tt><big>(</big><em>vmin=None</em>, <em>vmax=None</em>, <em>clip=False</em>, <em>vmid=None</em><big>)</big><a class="reference internal" href="_modules/agpy/asinh_norm.html#AsinhNorm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.asinh_norm.AsinhNorm" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="agpy.asinh_norm.AsinhNorm.autoscale_None">
<tt class="descname">autoscale_None</tt><big>(</big><em>A</em><big>)</big><a class="reference internal" href="_modules/agpy/asinh_norm.html#AsinhNorm.autoscale_None"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.asinh_norm.AsinhNorm.autoscale_None" title="Permalink to this definition">¶</a></dt>
<dd><p>autoscale only None-valued vmin or vmax</p>
</dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="module-agpy.blackbody">
<span id="blackbody-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">blackbody</span></tt> Module<a class="headerlink" href="#module-agpy.blackbody" title="Permalink to this headline">¶</a></h2>
<p>Includes both wavelength and frequency blackbody functions.  Has flexible
units.  Also allows for a few varieties of modified blackbody.</p>
<dl class="function">
<dt id="agpy.blackbody.blackbody">
<tt class="descclassname">agpy.blackbody.</tt><tt class="descname">blackbody</tt><big>(</big><em>nu</em>, <em>temperature</em>, <em>scale=1.0</em>, <em>units='cgs'</em>, <em>frequency_units='Hz'</em>, <em>normalize=&lt;built-in function max&gt;</em><big>)</big><a class="reference internal" href="_modules/agpy/blackbody.html#blackbody"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.blackbody.blackbody" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.blackbody.blackbody_wavelength">
<tt class="descclassname">agpy.blackbody.</tt><tt class="descname">blackbody_wavelength</tt><big>(</big><em>lam</em>, <em>temperature</em>, <em>scale=1.0</em>, <em>units='cgs'</em>, <em>wavelength_units='Angstroms'</em>, <em>normalize=&lt;built-in function max&gt;</em><big>)</big><a class="reference internal" href="_modules/agpy/blackbody.html#blackbody_wavelength"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.blackbody.blackbody_wavelength" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.blackbody.fit_blackbody">
<tt class="descclassname">agpy.blackbody.</tt><tt class="descname">fit_blackbody</tt><big>(</big><em>xdata</em>, <em>flux</em>, <em>guesses=(0</em>, <em>0)</em>, <em>err=None</em>, <em>blackbody_function=&lt;function blackbody at 0x10c95aaa0&gt;</em>, <em>quiet=True</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/blackbody.html#fit_blackbody"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.blackbody.fit_blackbody" title="Permalink to this definition">¶</a></dt>
<dd><p>guesses = Temperature, Arbitrary Scale
OR Temperature, Beta, Arbitrary Scale</p>
</dd></dl>

<dl class="function">
<dt id="agpy.blackbody.greybody">
<tt class="descclassname">agpy.blackbody.</tt><tt class="descname">greybody</tt><big>(</big><em>nu</em>, <em>temperature</em>, <em>beta</em>, <em>A=1.0</em>, <em>logscale=0.0</em>, <em>units='cgs'</em>, <em>frequency_units='Hz'</em>, <em>kappa0=4.0</em>, <em>nu0=3000000000000.0</em>, <em>normalize=&lt;built-in function max&gt;</em><big>)</big><a class="reference internal" href="_modules/agpy/blackbody.html#greybody"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.blackbody.greybody" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.blackbody.modified_blackbody">
<tt class="descclassname">agpy.blackbody.</tt><tt class="descname">modified_blackbody</tt><big>(</big><em>nu</em>, <em>temperature</em>, <em>beta=1.75</em>, <em>logscale=0.0</em>, <em>logN=22</em>, <em>muh2=2.7999999999999998</em>, <em>units='cgs'</em>, <em>frequency_units='Hz'</em>, <em>kappa0=4.0</em>, <em>nu0=505000000000.0</em>, <em>normalize=&lt;built-in function max&gt;</em><big>)</big><a class="reference internal" href="_modules/agpy/blackbody.html#modified_blackbody"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.blackbody.modified_blackbody" title="Permalink to this definition">¶</a></dt>
<dd><p>Snu =  2hnu^3 c^-2  (e^(hnu/kT) - 1)^-1  (1 - e^(-tau_nu) )
Kappa0 and Nu0 are set as per <a class="reference external" href="http://arxiv.org/abs/1101.4654">http://arxiv.org/abs/1101.4654</a> which uses OH94 values.
beta = 1.75 is a reasonable default for Herschel data
N = 1e22 is the column density in cm^-2</p>
<p>nu0 and nu must have same units!</p>
</dd></dl>

<dl class="function">
<dt id="agpy.blackbody.modified_blackbody_wavelength">
<tt class="descclassname">agpy.blackbody.</tt><tt class="descname">modified_blackbody_wavelength</tt><big>(</big><em>lam</em>, <em>temperature</em>, <em>beta=1.75</em>, <em>logscale=0.0</em>, <em>logN=22</em>, <em>muh2=2.7999999999999998</em>, <em>units='cgs'</em>, <em>wavelength_units='Angstroms'</em>, <em>kappa0=4.0</em>, <em>nu0=3000000000000.0</em>, <em>normalize=&lt;built-in function max&gt;</em><big>)</big><a class="reference internal" href="_modules/agpy/blackbody.html#modified_blackbody_wavelength"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.blackbody.modified_blackbody_wavelength" title="Permalink to this definition">¶</a></dt>
<dd><p>Snu =  2hnu^3 c^-2  (e^(hnu/kT) - 1)^-1  (1 - e^(-tau_nu) )
Kappa0 and Nu0 are set as per <a class="reference external" href="http://arxiv.org/abs/1101.4654">http://arxiv.org/abs/1101.4654</a> which uses OH94 values.
beta = 1.75 is a reasonable default for Herschel data
N = 1e22 is the column density in cm^-2</p>
<p>nu0 and nu must have same units!</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.collapse_gaussfit">
<span id="collapse-gaussfit-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">collapse_gaussfit</span></tt> Module<a class="headerlink" href="#module-agpy.collapse_gaussfit" title="Permalink to this headline">¶</a></h2>
<div class="section" id="collapse-gaussfit">
<h3>Collapse Gaussfit<a class="headerlink" href="#collapse-gaussfit" title="Permalink to this headline">¶</a></h3>
<p>This was an early attempt to automate gaussian fitting over a data cube using
(multiple) gaussian decomposition for each spectrum.   It&#8217;s reasonably
effective, but the uses are somewhat minimal.  I&#8217;ve tried shifting my
cube-related work to <a class="reference external" href="pyspeckit.bitbucket.org">pyspeckit</a>.</p>
<dl class="function">
<dt id="agpy.collapse_gaussfit.adaptive_collapse_gaussfit">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">adaptive_collapse_gaussfit</tt><big>(</big><em>cube</em>, <em>axis=2</em>, <em>nsig=3</em>, <em>nrsig=4</em>, <em>prefix='interesting'</em>, <em>vconv=&lt;function &lt;lambda&gt; at 0x10e1e2aa0&gt;</em>, <em>xtora=&lt;function &lt;lambda&gt; at 0x10e1e2b18&gt;</em>, <em>ytodec=&lt;function &lt;lambda&gt; at 0x10e1e2b90&gt;</em>, <em>doplot=True</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#adaptive_collapse_gaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.adaptive_collapse_gaussfit" title="Permalink to this definition">¶</a></dt>
<dd><p>Attempts to fit one or two Gaussians to each spectrum in a data cube and returns the parameters of the fits.
Adaptively determines where to fit two Gaussian components based on residuals.  Will fit 3 gaussians if a
two-gaussian fit is not better than a certain threshold (specified by nsig), and those fits will be output
to images with filename prefix+(coordinate).png.  The 3-gaussian fit parameters will not be returned because
the automated fitting is very unlikely to get that part right.</p>
<p>inputs:
cube - a data cube with two spatial and one spectral dimensions
axis - the axis of the spectral dimension
nsig - number of sigma over the mean residual to trigger double-gaussian fitting</p>
<blockquote>
<div>also, cutoff to do any fitting at all</div></blockquote>
<p>prefix - the prefix (including directory name) of the output images from 3-gaussian fitting
doplot - option to turn off plotting of triple-gaussian fits</p>
<p>vconv,xtora,ytodec - functions to convert the axes from pixel coordinates to ra/dec/velocity coordinates</p>
<p>returns:
width_arr1,width_arr2,chi2_arr,offset_arr1,offset_arr2,amp_arr1,amp_arr2
The Gaussian widths, line centers (in pixel units), amplitudes, and the chi-squared value, not in that order
These returns are identical to the returns from double_gaussian, but all components will be zero for the second
gaussian in the case of a single-gaussian fit</p>
<p>the triple gaussian is guessed to be the double gaussian plus a broad, low-amplitude gaussian.  Ideally this should
fit outflows reasonably well, but who knows if it really will.
Another option is to fit a negative-amplitude gaussian to account for self-absorption</p>
</dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.collapse_double_gaussfit">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">collapse_double_gaussfit</tt><big>(</big><em>cube</em>, <em>axis=2</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#collapse_double_gaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.collapse_double_gaussfit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.collapse_gaussfit">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">collapse_gaussfit</tt><big>(</big><em>cube</em>, <em>axis=2</em>, <em>negamp=False</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#collapse_gaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.collapse_gaussfit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.double_gaussian">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">double_gaussian</tt><big>(</big><em>dx1</em>, <em>dx2</em>, <em>sigma1</em>, <em>sigma2</em>, <em>a1</em>, <em>a2</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#double_gaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.double_gaussian" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.double_gerr">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">double_gerr</tt><big>(</big><em>xarr</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#double_gerr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.double_gerr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.gaussian">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">gaussian</tt><big>(</big><em>dx</em>, <em>sigma</em>, <em>a</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#gaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.gaussian" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.gerr">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">gerr</tt><big>(</big><em>xarr</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#gerr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.gerr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.n_gaussian">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">n_gaussian</tt><big>(</big><em>dx</em>, <em>sigma</em>, <em>a</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#n_gaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.n_gaussian" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.nanmean">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">nanmean</tt><big>(</big><em>arr</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#nanmean"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.nanmean" title="Permalink to this definition">¶</a></dt>
<dd><p>nanmean - this version is NOT capable of broadcasting (operating along axes)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.nanmedian">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">nanmedian</tt><big>(</big><em>arr</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#nanmedian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.nanmedian" title="Permalink to this definition">¶</a></dt>
<dd><p>nanmedian - this version is NOT capable of broadcasting (operating along axes)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.return_double_param">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">return_double_param</tt><big>(</big><em>xarr</em>, <em>params=None</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#return_double_param"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.return_double_param" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.return_param">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">return_param</tt><big>(</big><em>xarr</em>, <em>params=None</em>, <em>negamp=False</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#return_param"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.return_param" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.return_triple_param">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">return_triple_param</tt><big>(</big><em>xarr</em>, <em>params=None</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#return_triple_param"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.return_triple_param" title="Permalink to this definition">¶</a></dt>
<dd><p>input parameters: center[1-3],width[1-3],amplitude[1-3]</p>
</dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.triple_gaussian">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">triple_gaussian</tt><big>(</big><em>dx1</em>, <em>dx2</em>, <em>dx3</em>, <em>sigma1</em>, <em>sigma2</em>, <em>sigma3</em>, <em>a1</em>, <em>a2</em>, <em>a3</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#triple_gaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.triple_gaussian" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.triple_gerr">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">triple_gerr</tt><big>(</big><em>xarr</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#triple_gerr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.triple_gerr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.wrap_collapse_adaptive">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">wrap_collapse_adaptive</tt><big>(</big><em>filename</em>, <em>outprefix</em>, <em>redo='no'</em>, <em>nsig=5</em>, <em>nrsig=2</em>, <em>doplot=True</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#wrap_collapse_adaptive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.wrap_collapse_adaptive" title="Permalink to this definition">¶</a></dt>
<dd><p>redo - if not equal to &#8216;no&#8217;, then...
if collapse_gaussfit succeeded (to the extent that the .pysav files were written),
but some part of the file writing or successive procedures failed, re-do those 
procedures without redoing the whole collapse</p>
</dd></dl>

<dl class="function">
<dt id="agpy.collapse_gaussfit.wrap_collapse_gauss">
<tt class="descclassname">agpy.collapse_gaussfit.</tt><tt class="descname">wrap_collapse_gauss</tt><big>(</big><em>filename</em>, <em>outprefix</em>, <em>redo='no'</em><big>)</big><a class="reference internal" href="_modules/agpy/collapse_gaussfit.html#wrap_collapse_gauss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.collapse_gaussfit.wrap_collapse_gauss" title="Permalink to this definition">¶</a></dt>
<dd><p>redo - if not equal to &#8216;no&#8217;, then...
if collapse_gaussfit succeeded (to the extent that the .pysav files were written),
but some part of the file writing or successive procedures failed, re-do those 
procedures without redoing the whole collapse</p>
</dd></dl>

</div>
</div>
<div class="section" id="module-agpy.constants">
<span id="constants-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">constants</span></tt> Module<a class="headerlink" href="#module-agpy.constants" title="Permalink to this headline">¶</a></h2>
<p>A simple list of important constants in CGS units</p>
</div>
<div class="section" id="module-agpy.conversationcount">
<span id="conversationcount-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">conversationcount</span></tt> Module<a class="headerlink" href="#module-agpy.conversationcount" title="Permalink to this headline">¶</a></h2>
<p>Just for fun, histogram up number of conversations &amp; number of messages
exchanged with each person on your buddy list.  Meant for adium logs.</p>
</div>
<div class="section" id="module-agpy.cubes">
<span id="cubes-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">cubes</span></tt> Module<a class="headerlink" href="#module-agpy.cubes" title="Permalink to this headline">¶</a></h2>
<p>Many tools for cube manipulation.</p>
<p>See <a class="reference external" href="pyspeckit.bitbucket.org">pyspeckit</a> for a similar code better incorporated into a package</p>
<dl class="function">
<dt id="agpy.cubes.aper_world2pix">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">aper_world2pix</tt><big>(</big><em>ap</em>, <em>wcs</em>, <em>coordsys='galactic'</em>, <em>wunit='arcsec'</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#aper_world2pix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.aper_world2pix" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts an elliptical aperture (x,y,width,height,PA) from
WCS to pixel coordinates given an input wcs (an instance
of the pywcs.WCS class).  Must be a 2D WCS header.</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.coords_in_image">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">coords_in_image</tt><big>(</big><em>fitsfile</em>, <em>lon</em>, <em>lat</em>, <em>system='galactic'</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#coords_in_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.coords_in_image" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine whether the coordinates are inside the image</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.extract_aperture">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">extract_aperture</tt><big>(</big><em>cube</em>, <em>ap</em>, <em>r_mask=False</em>, <em>wcs=None</em>, <em>coordsys='galactic'</em>, <em>wunit='arcsec'</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#extract_aperture"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.extract_aperture" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract an aperture from a data cube.  E.g. to acquire a spectrum
of an outflow that is extended.</p>
<p>Cube should have shape [z,y,x], e.g. 
cube = pyfits.getdata(&#8216;datacube.fits&#8217;)</p>
<p>Apertures are specified in PIXEL units with an origin of 0,0 (NOT the 1,1
fits standard!) unless wcs and coordsys are specified</p>
<dl class="docutils">
<dt>INPUTS:</dt>
<dd><p class="first">wcs - a pywcs.WCS instance associated with the data cube
coordsys - the coordinate system the aperture is specified in.</p>
<blockquote>
<div>Options are &#8216;celestial&#8217; and &#8216;galactic&#8217;.  Default is &#8216;galactic&#8217;</div></blockquote>
<p class="last">wunit - units of width/height.  default &#8216;arcsec&#8217;, options &#8216;arcmin&#8217; and &#8216;degree&#8217;</p>
</dd>
<dt>For a circular aperture, len(ap)=3:</dt>
<dd>ap = [xcen,ycen,radius]</dd>
<dt>For an elliptical aperture, len(ap)=5:</dt>
<dd>ap = [xcen,ycen,height,width,PA]</dd>
<dt>Optional inputs:</dt>
<dd>r_mask - return mask in addition to spectrum (for error checking?)</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.flatten_header">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">flatten_header</tt><big>(</big><em>header</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#flatten_header"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.flatten_header" title="Permalink to this definition">¶</a></dt>
<dd><p>Attempt to turn an N-dimensional fits header into a 2-dimensional header
Turns all CRPIX[&gt;2] etc. into new keywords with suffix &#8216;A&#8217;</p>
<p>header must be a pyfits.Header instance</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.getspec">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">getspec</tt><big>(</big><em>lon</em>, <em>lat</em>, <em>rad</em>, <em>cube</em>, <em>header</em>, <em>r_fits=True</em>, <em>inherit=True</em>, <em>wunit='arcsec'</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#getspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.getspec" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a longitude, latitude, aperture radius (arcsec), and a cube file,
return a .fits file or a spectrum.</p>
<p>lon,lat - longitude and latitude center of a circular aperture in WCS coordinates
rad     - radius (default degrees) of aperture</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.getspec_reg">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">getspec_reg</tt><big>(</big><em>cubefilename</em>, <em>region</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#getspec_reg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.getspec_reg" title="Permalink to this definition">¶</a></dt>
<dd><p>Aperture extraction from a cube using a pyregion circle region</p>
<p>The region must be in the same coordinate system as the cube header</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.integ">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">integ</tt><big>(</big><em>file</em>, <em>vrange</em>, <em>xcen=None</em>, <em>xwidth=None</em>, <em>ycen=None</em>, <em>ywidth=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#integ"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.integ" title="Permalink to this definition">¶</a></dt>
<dd><p>wrapper of subimage_integ that defaults to using the full image</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.rotcrop_cube">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">rotcrop_cube</tt><big>(</big><em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em>, <em>cubename</em>, <em>outname</em>, <em>xwidth=25</em>, <em>ywidth=25</em>, <em>in_system='galactic'</em>, <em>out_system='equatorial'</em>, <em>clobber=True</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#rotcrop_cube"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.rotcrop_cube" title="Permalink to this definition">¶</a></dt>
<dd><p>Crop a data cube and then rotate it with montage</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.smooth_cube">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">smooth_cube</tt><big>(</big><em>cube</em>, <em>cubedim=0</em>, <em>parallel=True</em>, <em>numcores=None</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#smooth_cube"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.smooth_cube" title="Permalink to this definition">¶</a></dt>
<dd><p>parallel-map the smooth function</p>
<dl class="docutils">
<dt>parallel - defaults True.  Set to false if you want serial (for debug</dt>
<dd>purposes?)</dd>
</dl>
<p>numcores - pass to parallel_map (None = use all available)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.speccen_header">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">speccen_header</tt><big>(</big><em>header</em>, <em>lon=None</em>, <em>lat=None</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#speccen_header"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.speccen_header" title="Permalink to this definition">¶</a></dt>
<dd><p>Turn a cube header into a spectrum header, retaining RA/Dec vals where possible
(speccen is like flatten; spec-ify would be better but, specify?  nah)</p>
<p>Assumes 3rd axis is velocity</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.subcube">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">subcube</tt><big>(</big><em>cube</em>, <em>xcen</em>, <em>xwidth</em>, <em>ycen</em>, <em>ywidth</em>, <em>header=None</em>, <em>dvmult=False</em>, <em>return_HDU=False</em>, <em>units='pixels'</em>, <em>widthunits='pixels'</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#subcube"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.subcube" title="Permalink to this definition">¶</a></dt>
<dd><p>Crops a data cube</p>
<p>All units assumed to be pixel units</p>
<p>cube has dimensions (velocity, y, x)</p>
<p>xwidth and ywidth are &#8220;radius&#8221; values, i.e. half the length that will be extracted</p>
<p>if dvmult is set, multiple the average by DV (this is useful if you set
average=sum and dvmul=True to get an integrated value)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.cubes.subimage_integ">
<tt class="descclassname">agpy.cubes.</tt><tt class="descname">subimage_integ</tt><big>(</big><em>cube</em>, <em>xcen</em>, <em>xwidth</em>, <em>ycen</em>, <em>ywidth</em>, <em>vrange</em>, <em>header=None</em>, <em>average=&lt;function mean at 0x10317c668&gt;</em>, <em>dvmult=False</em>, <em>return_HDU=False</em>, <em>units='pixels'</em>, <em>zunits=None</em><big>)</big><a class="reference internal" href="_modules/agpy/cubes.html#subimage_integ"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cubes.subimage_integ" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a sub-image from a data cube integrated over the specified velocity range</p>
<p>All units assumed to be pixel units</p>
<p>cube has dimensions (velocity, y, x)</p>
<p>xwidth and ywidth are &#8220;radius&#8221; values, i.e. half the length that will be extracted</p>
<p>if dvmult is set, multiply the average by DV (this is useful if you set
average=sum and dvmul=True to get an integrated value)</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.cutout">
<span id="cutout-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">cutout</span></tt> Module<a class="headerlink" href="#module-agpy.cutout" title="Permalink to this headline">¶</a></h2>
<p>Generate a cutout image from a .fits file</p>
<dl class="exception">
<dt id="agpy.cutout.DimensionError">
<em class="property">exception </em><tt class="descclassname">agpy.cutout.</tt><tt class="descname">DimensionError</tt><a class="reference internal" href="_modules/agpy/cutout.html#DimensionError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cutout.DimensionError" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.cutout.cutout">
<tt class="descclassname">agpy.cutout.</tt><tt class="descname">cutout</tt><big>(</big><em>filename</em>, <em>xc</em>, <em>yc</em>, <em>xw=25</em>, <em>yw=25</em>, <em>units='pixels'</em>, <em>outfile=None</em>, <em>clobber=True</em>, <em>useMontage=False</em>, <em>coordsys='celestial'</em>, <em>verbose=False</em><big>)</big><a class="reference internal" href="_modules/agpy/cutout.html#cutout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.cutout.cutout" title="Permalink to this definition">¶</a></dt>
<dd><p>Inputs:
file  - .fits filename or pyfits HDUList (must be 2D)
xc,yc - x and y coordinates in the fits files&#8217; coordinate system (CTYPE)
xw,yw - x and y width (pixels or wcs)
units - specify units to use: either pixels or wcs
outfile - optional output file</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.densitymap">
<span id="densitymap-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">densitymap</span></tt> Module<a class="headerlink" href="#module-agpy.densitymap" title="Permalink to this headline">¶</a></h2>
<p>Build a density map out of a list of coordinates</p>
<dl class="function">
<dt id="agpy.densitymap.densitymap">
<tt class="descclassname">agpy.densitymap.</tt><tt class="descname">densitymap</tt><big>(</big><em>header</em>, <em>xi</em>, <em>yi</em>, <em>smoothpix=1</em>, <em>outfits=None</em>, <em>clobber=True</em><big>)</big><a class="reference internal" href="_modules/agpy/densitymap.html#densitymap"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.densitymap.densitymap" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates a source-density map given a region file
or a list of coordinates</p>
<p>this should be done with np.histogram2d</p>
</dd></dl>

<dl class="function">
<dt id="agpy.densitymap.dmregion">
<tt class="descclassname">agpy.densitymap.</tt><tt class="descname">dmregion</tt><big>(</big><em>header</em>, <em>region</em>, <em>outfits=None</em>, <em>smoothpix=2</em>, <em>clobber=True</em><big>)</big><a class="reference internal" href="_modules/agpy/densitymap.html#dmregion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.densitymap.dmregion" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a valid .FITS header with WCS coordinates
and a ds9 region file, creates a density map of 
ds9 objects (doesn&#8217;t filter by shape type).
Default smoothing is by a sigma=2 pixels gaussian.
Specify outfits to write to a fits file, otherwise
returns the map</p>
</dd></dl>

<dl class="function">
<dt id="agpy.densitymap.reg_to_xy">
<tt class="descclassname">agpy.densitymap.</tt><tt class="descname">reg_to_xy</tt><big>(</big><em>region</em>, <em>header</em><big>)</big><a class="reference internal" href="_modules/agpy/densitymap.html#reg_to_xy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.densitymap.reg_to_xy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.ds9_phot">
<span id="ds9-phot-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">ds9_phot</span></tt> Module<a class="headerlink" href="#module-agpy.ds9_phot" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.ds9_phot.ds9_photometry">
<tt class="descclassname">agpy.ds9_phot.</tt><tt class="descname">ds9_photometry</tt><big>(</big><em>xpapoint</em><big>)</big><a class="reference internal" href="_modules/agpy/ds9_phot.html#ds9_photometry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.ds9_phot.ds9_photometry" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.dust">
<span id="dust-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">dust</span></tt> Module<a class="headerlink" href="#module-agpy.dust" title="Permalink to this headline">¶</a></h2>
<p>nu is in GHz everywhere</p>
<dl class="function">
<dt id="agpy.dust.colofsnu">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">colofsnu</tt><big>(</big><em>nu</em>, <em>snu</em>, <em>beamomega</em>, <em>temperature=20</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#colofsnu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.colofsnu" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.dust.kappa">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">kappa</tt><big>(</big><em>nu</em>, <em>nu0=599584916000.0</em>, <em>kappa0=0.0050000000000000001</em>, <em>beta=1.75</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#kappa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.kappa" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.dust.massofsnu">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">massofsnu</tt><big>(</big><em>nu</em>, <em>snu</em>, <em>beamomega</em>, <em>distance=1</em>, <em>temperature=20</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#massofsnu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.massofsnu" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.dust.snu">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">snu</tt><big>(</big><em>nu</em>, <em>column</em>, <em>kappa</em>, <em>temperature</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#snu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.snu" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.dust.snudnu">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">snudnu</tt><big>(</big><em>nu</em>, <em>column</em>, <em>kappa</em>, <em>temperature</em>, <em>bandwidth</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#snudnu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.snudnu" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.dust.snuofmass">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">snuofmass</tt><big>(</big><em>nu</em>, <em>mass</em>, <em>beamomega</em>, <em>distance=1</em>, <em>temperature=20</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#snuofmass"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.snuofmass" title="Permalink to this definition">¶</a></dt>
<dd><p>nu in Hz
snu in Jy</p>
</dd></dl>

<dl class="function">
<dt id="agpy.dust.tauofsnu">
<tt class="descclassname">agpy.dust.</tt><tt class="descname">tauofsnu</tt><big>(</big><em>nu</em>, <em>snu</em>, <em>beamomega</em>, <em>temperature=20</em><big>)</big><a class="reference internal" href="_modules/agpy/dust.html#tauofsnu"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.dust.tauofsnu" title="Permalink to this definition">¶</a></dt>
<dd><p>nu in GHz
snu in Jy</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.gaussfitter">
<span id="gaussfitter-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">gaussfitter</span></tt> Module<a class="headerlink" href="#module-agpy.gaussfitter" title="Permalink to this headline">¶</a></h2>
<p>Latest version available at &lt;<a class="reference external" href="http://code.google.com/p/agpy/source/browse/trunk/agpy/gaussfitter.py">http://code.google.com/p/agpy/source/browse/trunk/agpy/gaussfitter.py</a>&gt;</p>
<dl class="function">
<dt id="agpy.gaussfitter.collapse_gaussfit">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">collapse_gaussfit</tt><big>(</big><em>cube</em>, <em>xax=None</em>, <em>axis=2</em>, <em>negamp=False</em>, <em>usemoments=True</em>, <em>nsigcut=1.0</em>, <em>mppsigcut=1.0</em>, <em>return_errors=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#collapse_gaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.collapse_gaussfit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.gaussfit">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">gaussfit</tt><big>(</big><em>data, err=None, params=(), autoderiv=True, return_all=False, circle=False, fixed=array([False, False, False, False, False, False, False], dtype=bool), limitedmin=[False, False, False, False, True, True, True], limitedmax=[False, False, False, False, False, False, True], usemoment=array([], dtype=bool), minpars=array([0, 0, 0, 0, 0, 0, 0]), maxpars=[0, 0, 0, 0, 0, 0, 360], rotate=1, vheight=1, quiet=True, returnmp=False, returnfitimage=False, **kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#gaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.gaussfit" title="Permalink to this definition">¶</a></dt>
<dd><p>Gaussian fitter with the ability to fit a variety of different forms of
2-dimensional gaussian.</p>
<dl class="docutils">
<dt>Input Parameters:</dt>
<dd><p class="first">data - 2-dimensional data array
err=None - error array with same size as data array
params=[] - initial input parameters for Gaussian function.</p>
<blockquote>
<div>(height, amplitude, x, y, width_x, width_y, rota)
if not input, these will be determined from the moments of the system, 
assuming no rotation</div></blockquote>
<dl class="docutils">
<dt>autoderiv=1 - use the autoderiv provided in the lmder.f function (the</dt>
<dd>alternative is to us an analytic derivative with lmdif.f: this method
is less robust)</dd>
<dt>return_all=0 - Default is to return only the Gaussian parameters.  </dt>
<dd>1 - fit params, fit error</dd>
</dl>
<p>returnfitimage - returns (best fit params,best fit image)
returnmp - returns the full mpfit struct
circle=0 - default is an elliptical gaussian (different x, y widths),</p>
<blockquote>
<div>but can reduce the input by one parameter if it&#8217;s a circular gaussian</div></blockquote>
<dl class="last docutils">
<dt>rotate=1 - default allows rotation of the gaussian ellipse.  Can remove</dt>
<dd>last parameter by setting rotate=0.  numpy.expects angle in DEGREES</dd>
<dt>vheight=1 - default allows a variable height-above-zero, i.e. an</dt>
<dd>additive constant for the Gaussian function.  Can remove first
parameter by setting this to 0</dd>
<dt>usemoment - can choose which parameters to use a moment estimation for.</dt>
<dd>Other parameters will be taken from params.  Needs to be a boolean
array.</dd>
</dl>
</dd>
<dt>Output:</dt>
<dd><dl class="first docutils">
<dt>Default output is a set of Gaussian parameters with the same shape as</dt>
<dd>the input parameters</dd>
<dt>Can also output the covariance matrix, &#8216;infodict&#8217; that contains a lot</dt>
<dd>more detail about the fit (see scipy.optimize.leastsq), and a message
from leastsq telling what the exit status of the fitting routine was</dd>
</dl>
<p class="last">Warning: Does NOT necessarily output a rotation angle between 0 and 360 degrees.</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.moments">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">moments</tt><big>(</big><em>data</em>, <em>circle</em>, <em>rotate</em>, <em>vheight</em>, <em>estimator=&lt;function median at 0x1037f9488&gt;</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#moments"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.moments" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns (height, amplitude, x, y, width_x, width_y, rotation angle)
the gaussian parameters of a 2D distribution by calculating its
moments.  Depending on the input parameters, will only output 
a subset of the above.</p>
<p>If using masked arrays, pass estimator=numpy.ma.median</p>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.multigaussfit">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">multigaussfit</tt><big>(</big><em>xax, data, ngauss=1, err=None, params=[1, 0, 1], fixed=[False, False, False], limitedmin=[False, False, True], limitedmax=[False, False, False], minpars=[0, 0, 0], maxpars=[0, 0, 0], quiet=True, shh=True, veryverbose=False</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#multigaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.multigaussfit" title="Permalink to this definition">¶</a></dt>
<dd><p>An improvement on onedgaussfit.  Lets you fit multiple gaussians.</p>
<dl class="docutils">
<dt>Inputs:</dt>
<dd><blockquote class="first">
<div>xax - x axis
data - y axis
ngauss - How many gaussians to fit?  Default 1 (this could supersede onedgaussfit)
err - error corresponding to data</div></blockquote>
<p>These parameters need to have length = 3*ngauss.  If ngauss &gt; 1 and length = 3, they will
be replicated ngauss times, otherwise they will be reset to defaults:</p>
<blockquote class="last">
<div><dl class="docutils">
<dt>params - Fit parameters: [amplitude, offset, width] * ngauss</dt>
<dd>If len(params) % 3 == 0, ngauss will be set to len(params) / 3</dd>
</dl>
<p>fixed - Is parameter fixed?
limitedmin/minpars - set lower limits on each parameter (default: width&gt;0)
limitedmax/maxpars - set upper limits on each parameter</p>
<p>quiet - should MPFIT output each iteration?
shh - output final parameters?</p>
</div></blockquote>
</dd>
<dt>Returns:</dt>
<dd>Fit parameters
Model
Fit errors
chi2</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.n_gaussian">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">n_gaussian</tt><big>(</big><em>pars=None</em>, <em>a=None</em>, <em>dx=None</em>, <em>sigma=None</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#n_gaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.n_gaussian" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a function that sums over N gaussians, where N is the length of
a,dx,sigma <em>OR</em> N = len(pars) / 3</p>
<p>The background &#8220;height&#8221; is assumed to be zero (you must &#8220;baseline&#8221; your
spectrum before fitting)</p>
<p>pars  - a list with len(pars) = 3n, assuming a,dx,sigma repeated
dx    - offset (velocity center) values
sigma - line widths
a     - amplitudes</p>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.onedgaussfit">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">onedgaussfit</tt><big>(</big><em>xax, data, err=None, params=[0, 1, 0, 1], fixed=[False, False, False, False], limitedmin=[False, False, False, True], limitedmax=[False, False, False, False], minpars=[0, 0, 0, 0], maxpars=[0, 0, 0, 0], quiet=True, shh=True, veryverbose=False, vheight=True, negamp=False, usemoments=False</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#onedgaussfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.onedgaussfit" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Inputs:</dt>
<dd><p class="first">xax - x axis
data - y axis
err - error corresponding to data</p>
<p class="last">params - Fit parameters: Height of background, Amplitude, Shift, Width
fixed - Is parameter fixed?
limitedmin/minpars - set lower limits on each parameter (default: width&gt;0)
limitedmax/maxpars - set upper limits on each parameter
quiet - should MPFIT output each iteration?
shh - output final parameters?
usemoments - replace default parameters with moments</p>
</dd>
<dt>Returns:</dt>
<dd>Fit parameters
Model
Fit errors
chi2</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.onedgaussian">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">onedgaussian</tt><big>(</big><em>x</em>, <em>H</em>, <em>A</em>, <em>dx</em>, <em>w</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#onedgaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.onedgaussian" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a 1-dimensional gaussian of form
H+A*numpy.exp(-(x-dx)**2/(2*w**2))</p>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.onedmoments">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">onedmoments</tt><big>(</big><em>Xax</em>, <em>data</em>, <em>vheight=True</em>, <em>estimator=&lt;function median at 0x1037f9488&gt;</em>, <em>negamp=None</em>, <em>veryverbose=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#onedmoments"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.onedmoments" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns (height, amplitude, x, width_x)
the gaussian parameters of a 1D distribution by calculating its
moments.  Depending on the input parameters, will only output 
a subset of the above.</p>
<p>If using masked arrays, pass estimator=numpy.ma.median
&#8216;estimator&#8217; is used to measure the background level (height)</p>
<p>negamp can be used to force the peak negative (True), positive (False),
or it will be &#8220;autodetected&#8221; (negamp=None)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.gaussfitter.twodgaussian">
<tt class="descclassname">agpy.gaussfitter.</tt><tt class="descname">twodgaussian</tt><big>(</big><em>inpars</em>, <em>circle=False</em>, <em>rotate=True</em>, <em>vheight=True</em>, <em>shape=None</em><big>)</big><a class="reference internal" href="_modules/agpy/gaussfitter.html#twodgaussian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.gaussfitter.twodgaussian" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a 2d gaussian function of the form:
x&#8217; = numpy.cos(rota) * x - numpy.sin(rota) * y
y&#8217; = numpy.sin(rota) * x + numpy.cos(rota) * y
(rota should be in degrees)
g = b + a * numpy.exp ( - ( ((x-center_x)/width_x)**2 +
((y-center_y)/width_y)**2 ) / 2 )</p>
<dl class="docutils">
<dt>inpars = [b,a,center_x,center_y,width_x,width_y,rota]</dt>
<dd>(b is background height, a is peak amplitude)</dd>
</dl>
<p>where x and y are the input parameters of the returned function,
and all other parameters are specified by this function</p>
<p>However, the above values are passed by list.  The list should be:
inpars = (height,amplitude,center_x,center_y,width_x,width_y,rota)</p>
<dl class="docutils">
<dt>You can choose to ignore / neglect some of the above input parameters </dt>
<dd><p class="first">unumpy.sing the following options:
circle=0 - default is an elliptical gaussian (different x, y</p>
<blockquote>
<div>widths), but can reduce the input by one parameter if it&#8217;s a
circular gaussian</div></blockquote>
<dl class="last docutils">
<dt>rotate=1 - default allows rotation of the gaussian ellipse.  Can</dt>
<dd>remove last parameter by setting rotate=0</dd>
<dt>vheight=1 - default allows a variable height-above-zero, i.e. an</dt>
<dd>additive constant for the Gaussian function.  Can remove first
parameter by setting this to 0</dd>
<dt>shape=None - if shape is set (to a 2-parameter list) then returns</dt>
<dd>an image with the gaussian defined by inpars</dd>
</dl>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-agpy.get_cutouts">
<span id="get-cutouts-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">get_cutouts</span></tt> Module<a class="headerlink" href="#module-agpy.get_cutouts" title="Permalink to this headline">¶</a></h2>
<p>Make cutouts with all available data of a given position</p>
<dl class="function">
<dt id="agpy.get_cutouts.coords_in_image">
<tt class="descclassname">agpy.get_cutouts.</tt><tt class="descname">coords_in_image</tt><big>(</big><em>xc</em>, <em>yc</em>, <em>header</em>, <em>coordsys='celestial'</em><big>)</big><a class="reference internal" href="_modules/agpy/get_cutouts.html#coords_in_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.get_cutouts.coords_in_image" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine whether the coordinates are within the boundaries of the image</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.grep">
<span id="grep-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">grep</span></tt> Module<a class="headerlink" href="#module-agpy.grep" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.grep.grep">
<tt class="descclassname">agpy.grep.</tt><tt class="descname">grep</tt><big>(</big><em>string</em>, <em>list</em><big>)</big><a class="reference internal" href="_modules/agpy/grep.html#grep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.grep.grep" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.grep.grepv">
<tt class="descclassname">agpy.grep.</tt><tt class="descname">grepv</tt><big>(</big><em>string</em>, <em>list</em><big>)</big><a class="reference internal" href="_modules/agpy/grep.html#grepv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.grep.grepv" title="Permalink to this definition">¶</a></dt>
<dd><p>grep -v - return elements that do NOT contain the string</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.h2fit">
<span id="h2fit-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">h2fit</span></tt> Module<a class="headerlink" href="#module-agpy.h2fit" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.h2fit.aval">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">aval</tt><big>(</big><em>v</em>, <em>ju</em>, <em>jl</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#aval"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.aval" title="Permalink to this definition">¶</a></dt>
<dd><p>Lookup table for Einstein-A value as a function of 
vibrational level, upper/lower J level
Values from: <a class="reference external" href="http://www.jach.hawaii.edu/UKIRT/astronomy/calib/spec_cal/h2_s.html">http://www.jach.hawaii.edu/UKIRT/astronomy/calib/spec_cal/h2_s.html</a></p>
</dd></dl>

<dl class="function">
<dt id="agpy.h2fit.extinctandplot">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">extinctandplot</tt><big>(</big><em>specsegments</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#extinctandplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.extinctandplot" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.extinctfit">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">extinctfit</tt><big>(</big><em>ss</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#extinctfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.extinctfit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.fitalllines">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">fitalllines</tt><big>(</big><em>specsegments</em>, <em>apname='aperture'</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#fitalllines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.fitalllines" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.fitandplot">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">fitandplot</tt><big>(</big><em>image, noiseimage, aperture=[], noiseaperture=[0, 10], modelspec=&lt;function modelspec at 0x10e2a10c8&gt;, parinfo=[{'limited': [1, 1], 'limits': [200.0, 15000.0], 'value': 2000, 'n': 0, 'error': 0, 'fixed': 0, 'parname': 'TEMPERATURE'}, {'limited': [1, 0], 'limits': [0, 0], 'value': 5.0000000000000001e-09, 'n': 1, 'error': 0, 'fixed': 0, 'parname': 'SCALE'}, {'limited': [1, 1], 'limits': [0, 1000.0], 'value': 31.100000000000001, 'n': 2, 'error': 0, 'fixed': 0, 'parname': 'WIDTH'}, {'limited': [1, 1], 'limits': [-500.0, 500.0], 'value': -20.0, 'n': 3, 'error': 0, 'fixed': 0, 'parname': 'SHIFT'}, {'limited': [1, 1], 'limits': [1.5, 3.5], 'value': 3, 'n': 4, 'error': 0, 'fixed': 0, 'parname': 'ORTHOtoPARA'}], nameregex='-', vlsrcorr=0, extinction=False, quiet=1</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#fitandplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.fitandplot" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.fitandplotspex">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">fitandplotspex</tt><big>(</big><em>image, modelspec=&lt;function modelspec at 0x10e2a10c8&gt;, parinfo=[{'limited': [1, 1], 'limits': [200.0, 15000.0], 'value': 2000, 'n': 0, 'error': 0, 'fixed': 0, 'parname': 'TEMPERATURE'}, {'limited': [1, 0], 'limits': [0, 0], 'value': 5.0000000000000001e-09, 'n': 1, 'error': 0, 'fixed': 0, 'parname': 'SCALE'}, {'limited': [1, 1], 'limits': [0, 1000.0], 'value': 31.100000000000001, 'n': 2, 'error': 0, 'fixed': 0, 'parname': 'WIDTH'}, {'limited': [1, 1], 'limits': [-500.0, 500.0], 'value': -20.0, 'n': 3, 'error': 0, 'fixed': 0, 'parname': 'SHIFT'}, {'limited': [1, 1], 'limits': [1.5, 3.5], 'value': 3, 'n': 4, 'error': 0, 'fixed': 0, 'parname': 'ORTHOtoPARA'}], nameregex='-', vlsrcorr=0, extinction=False, quiet=1, **kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#fitandplotspex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.fitandplotspex" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.fitspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">fitspec</tt><big>(</big><em>specsegments, aperture=None, modelspec=&lt;function modelspec at 0x10e2a10c8&gt;, outpars=False, vlsrcorr=0, extinction=False, parinfo=[{'limited': [1, 1], 'limits': [200.0, 15000.0], 'value': 2000, 'n': 0, 'error': 0, 'fixed': 0, 'parname': 'TEMPERATURE'}, {'limited': [1, 0], 'limits': [0, 0], 'value': 5.0000000000000001e-09, 'n': 1, 'error': 0, 'fixed': 0, 'parname': 'SCALE'}, {'limited': [1, 1], 'limits': [0, 1000.0], 'value': 31.100000000000001, 'n': 2, 'error': 0, 'fixed': 0, 'parname': 'WIDTH'}, {'limited': [1, 1], 'limits': [-500.0, 500.0], 'value': -20.0, 'n': 3, 'error': 0, 'fixed': 0, 'parname': 'SHIFT'}, {'limited': [1, 1], 'limits': [1.5, 3.5], 'value': 3, 'n': 4, 'error': 0, 'fixed': 0, 'parname': 'ORTHOtoPARA'}], quiet=1, **kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#fitspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.fitspec" title="Permalink to this definition">¶</a></dt>
<dd><p>fit a model spectrum 
The model is defined internal to fitspec so that parameters can
be fixed based on input parameters</p>
</dd></dl>

<dl class="function">
<dt id="agpy.h2fit.h2level_energy">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">h2level_energy</tt><big>(</big><em>V</em>, <em>J</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#h2level_energy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.h2level_energy" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the theoretical level energy as a function of the
vibrational (V) and rotational (J) state of the molecule. 
in units of ergs</p>
<p>Constants are from NIST: 
<a class="reference external" href="http://webbook.nist.gov/cgi/cbook.cgi?ID=C1333740&amp;Units=SI&amp;Mask=1000#Diatomic">http://webbook.nist.gov/cgi/cbook.cgi?ID=C1333740&amp;Units=SI&amp;Mask=1000#Diatomic</a>
(see the bottom of the table)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.h2fit.linefit">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">linefit</tt><big>(</big><em>ss</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#linefit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.linefit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.linename_to_restwl">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">linename_to_restwl</tt><big>(</big><em>linelistfile='/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/agpy/h2fit/linelist.txt'</em>, <em>outfile='/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/agpy/h2fit/newlinelist.txt'</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#linename_to_restwl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.linename_to_restwl" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.modelpars">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">modelpars</tt><big>(</big><em>fixpars=[None, None, None, None, None], minpars=[200.0, 0, 0, -500.0, 1.5], maxpars=[15000.0, None, 1000.0, 500.0, 3.5], params=[2000, 5.0000000000000001e-09, 31.100000000000001, -20.0, 3], extinction=False, **kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#modelpars"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.modelpars" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.modelspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">modelspec</tt><big>(</big><em>x</em>, <em>T</em>, <em>A</em>, <em>w</em>, <em>dx</em>, <em>op</em>, <em>Ak=0</em>, <em>extinction=False</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#modelspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.modelspec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.modpar">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">modpar</tt><big>(</big><em>parinfo</em>, <em>fieldnum</em>, <em>value=None</em>, <em>fixed=False</em>, <em>lowlim=None</em>, <em>uplim=None</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#modpar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.modpar" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.nonetozero">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">nonetozero</tt><big>(</big><em>x</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#nonetozero"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.nonetozero" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.plotspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">plotspec</tt><big>(</big><em>specsegments</em>, <em>scalefactor=1e+17</em>, <em>units='mJy'</em>, <em>restwl=-17.5</em>, <em>fignum=0</em>, <em>titletype='line'</em>, <em>matchaxes=False</em>, <em>vframe='lsr'</em>, <em>fitcenter=False</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#plotspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.plotspec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.plotss">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">plotss</tt><big>(</big><em>ss</em>, <em>scalefactor=1e+17</em>, <em>units='mJy'</em>, <em>restwl=-17.5</em>, <em>vframe='lsr'</em>, <em>fitcenter=False</em>, <em>atmotrans=False</em>, <em>label=True</em>, <em>title=''</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#plotss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.plotss" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.printfslist">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">printfslist</tt><big>(</big><em>fslist</em>, <em>apnamelist</em>, <em>outfilename='line_measurements.csv'</em>, <em>fsep='</em>, <em>'</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#printfslist"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.printfslist" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.readspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">readspec</tt><big>(</big><em>image, noiseimage, linelistfile='/Users/adam/work/IRAS05358/code/linelist.txt', path_obs='', noiseaperture=[0, 10], aperture=[], nameregex='2-1 S\\(1\\)|1-0 S\\([1379028]\\)|1-0 Q\\([1234]\\)|3-2 S\\([35]\\)|4-3 S\\(5\\)', apname='', vlsrcorr=0</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#readspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.readspec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.readspexspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">readspexspec</tt><big>(</big><em>image</em>, <em>linelistfile='/Users/adam/work/IRAS05358/code/linelist.txt'</em>, <em>path_obs=''</em>, <em>nameregex='2-1 S\\(1\\)|1-0 S\\([1379028]\\)|1-0 Q\\([1234]\\)|3-2 S\\([35]\\)|4-3 S\\(5\\)'</em>, <em>vlsrcorr=0</em>, <em>backsub=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#readspexspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.readspexspec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.readstarspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">readstarspec</tt><big>(</big><em>image, noiseimage, linelistfile='/Users/adam/work/IRAS05358/code/linelist.txt', path_obs='/Users/adam/work/IRAS05358/spectra/nearir/', noiseaperture=[0, 10], aperture=[]</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#readstarspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.readstarspec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.showpars">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">showpars</tt><big>(</big><em>parinfo</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#showpars"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.showpars" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.testnone">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">testnone</tt><big>(</big><em>x</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#testnone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.testnone" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.twoTmodelpars">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">twoTmodelpars</tt><big>(</big><em>fixpars=[None, None, None, None, None, None, None, None, None, None], minpars=[200.0, 0, 0, -500.0, 1.0, 200.0, 0, 0, -500.0, 1.0], maxpars=[15000.0, None, 1000.0, 500.0, 5.0, 15000.0, None, 1000.0, 500.0, 5.0], params=[2000, 5.0000000000000001e-09, 3.1000000000000001, -2.0, 3, 2000, 5.0000000000000001e-09, 3.1000000000000001, -2.0, 3]</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#twoTmodelpars"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.twoTmodelpars" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.h2fit.twoTmodelspec">
<tt class="descclassname">agpy.h2fit.</tt><tt class="descname">twoTmodelspec</tt><big>(</big><em>x</em>, <em>T1</em>, <em>A1</em>, <em>w1</em>, <em>dx1</em>, <em>op1</em>, <em>T2</em>, <em>A2</em>, <em>w2</em>, <em>dx2</em>, <em>op2</em><big>)</big><a class="reference internal" href="_modules/agpy/h2fit.html#twoTmodelspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.h2fit.twoTmodelspec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.hotwind">
<span id="hotwind-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">hotwind</span></tt> Module<a class="headerlink" href="#module-agpy.hotwind" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.hotwind.LofMdot">
<tt class="descclassname">agpy.hotwind.</tt><tt class="descname">LofMdot</tt><big>(</big><em>logdmom</em>, <em>x=1.51</em>, <em>D0=20.690000000000001</em>, <em>alphaP=0.66000000000000003</em><big>)</big><a class="reference internal" href="_modules/agpy/hotwind.html#LofMdot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.hotwind.LofMdot" title="Permalink to this definition">¶</a></dt>
<dd><p>Kudritzki 2000
log Dmom - log D0 = x log(L/Lsun); Dmom = Mdot * vinf <a href="#id4"><span class="problematic" id="id5">*</span></a>R/rsun</p>
<p>returns L in log10(Lsun)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.hotwind.SnuOfMdot">
<tt class="descclassname">agpy.hotwind.</tt><tt class="descname">SnuOfMdot</tt><big>(</big><em>nu</em>, <em>dkpc</em>, <em>mdot=1.0000000000000001e-05</em>, <em>mu=1.2</em>, <em>vwind=1000.0</em>, <em>Zbar=1</em>, <em>Te=10000.0</em><big>)</big><a class="reference internal" href="_modules/agpy/hotwind.html#SnuOfMdot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.hotwind.SnuOfMdot" title="Permalink to this definition">¶</a></dt>
<dd><p>Panagia and Felli 1975 equation 24</p>
<p>[nu] = GHz
[Te] = K
[mdot] = msun/yr
[vwind] = km/s
mu = mean particle mass in AMU (presumably)
Zbar = average ionic charge (assumed 1, but not sure that&#8217;s good)
dkpc = distance in kpc</p>
</dd></dl>

<dl class="function">
<dt id="agpy.hotwind.mdot">
<tt class="descclassname">agpy.hotwind.</tt><tt class="descname">mdot</tt><big>(</big><em>snu</em>, <em>nu=10</em>, <em>Te=10000.0</em>, <em>vinf=2000</em>, <em>mue=1.3</em>, <em>d=1</em><big>)</big><a class="reference internal" href="_modules/agpy/hotwind.html#mdot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.hotwind.mdot" title="Permalink to this definition">¶</a></dt>
<dd><p>[snu] = mJy
nu = 10 GHz (frequency)
Te = 10^4 K (ionized gas temp)
vinf = 2000 km/s (maximum wind speed)
mue = 1.3 (mean atomic weight per free electron)
d = distance (kpc)</p>
<p>return: mdot in Msun/yr</p>
</dd></dl>

<dl class="function">
<dt id="agpy.hotwind.mdotvinfr">
<tt class="descclassname">agpy.hotwind.</tt><tt class="descname">mdotvinfr</tt><big>(</big><em>snu</em>, <em>nu=10</em>, <em>Te=10000.0</em>, <em>vinf=2000</em>, <em>mue=1.3</em>, <em>d=1</em>, <em>R=25</em><big>)</big><a class="reference internal" href="_modules/agpy/hotwind.html#mdotvinfr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.hotwind.mdotvinfr" title="Permalink to this definition">¶</a></dt>
<dd><p>[snu] = mJy
nu = 10 GHz (frequency)
Te = 10^4 K (ionized gas temp)
vinf = 2000 km/s (maximum wind speed)
mue = 1.3 (mean atomic weight per free electron)
d = distance (kpc)</p>
<p>return: Dmom in g*cm/s^2</p>
<p>Sp. type Log D0 x alphaP
A I 14.22    2.41 2.64       0.47 0.38       0.07
Mid B I 17.07        1.05 1.95       0.20 0.51       0.05
Early B I 21.24      1.38 1.34       0.25 0.75       0.15
O I 20.69    1.04 1.51       0.18 0.66       0.06
O III, V 19.87       1.21 1.57       0.21 0.64       0.06</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.imf">
<span id="imf-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">imf</span></tt> Module<a class="headerlink" href="#module-agpy.imf" title="Permalink to this headline">¶</a></h2>
<p>Various codes to work with the initial mass function</p>
<dl class="function">
<dt id="agpy.imf.chabrier">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">chabrier</tt><big>(</big><em>m</em>, <em>integral=False</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#chabrier"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.chabrier" title="Permalink to this definition">¶</a></dt>
<dd><p>Chabrier 2003 IMF
<a class="reference external" href="http://adsabs.harvard.edu/abs/2003PASP..115..763C">http://adsabs.harvard.edu/abs/2003PASP..115..763C</a>
(only valid for m &lt; 1 msun)</p>
<p>not sure which of these to use...</p>
<p>integral is NOT IMPLEMENTED</p>
</dd></dl>

<dl class="function">
<dt>
<tt class="descname">cumint(fn=&lt;function kroupa at 0x10e2b3050&gt;, bins=array([  1.00000000e-02,   1.01862899e-02,   1.03760502e-02,</tt></dt>
<dt>
<tt class="descname">1.05693455e-02,   1.07662418e-02,   1.09668060e-02,</tt></dt>
<dt>
<tt class="descname">1.11711065e-02,   1.13792129e-02,   1.15911962e-02,</tt></dt>
<dt>
<tt class="descname">1.18071285e-02,   1.20270833e-02,   1.22511358e-02,</tt></dt>
<dt>
<tt class="descname">1.24793621e-02,   1.27118400e-02,   1.29486487e-02,</tt></dt>
<dt>
<tt class="descname">1.31898690e-02,   1.34355829e-02,   1.36858742e-02,</tt></dt>
<dt>
<tt class="descname">1.39408283e-02,   1.42005318e-02,   1.44650734e-02,</tt></dt>
<dt>
<tt class="descname">1.47345431e-02,   1.50090328e-02,   1.52886359e-02,</tt></dt>
<dt>
<tt class="descname">1.55734477e-02,   1.58635653e-02,   1.61590875e-02,</tt></dt>
<dt>
<tt class="descname">1.64601150e-02,   1.67667503e-02,   1.70790980e-02,</tt></dt>
<dt>
<tt class="descname">1.73972643e-02,   1.77213578e-02,   1.80514888e-02,</tt></dt>
<dt>
<tt class="descname">1.83877698e-02,   1.87303154e-02,   1.90792422e-02,</tt></dt>
<dt>
<tt class="descname">1.94346693e-02,   1.97967175e-02,   2.01655104e-02,</tt></dt>
<dt>
<tt class="descname">2.05411735e-02,   2.09238348e-02,   2.13136247e-02,</tt></dt>
<dt>
<tt class="descname">2.17106760e-02,   2.21151240e-02,   2.25271064e-02,</tt></dt>
<dt>
<tt class="descname">2.29467637e-02,   2.33742387e-02,   2.38096772e-02,</tt></dt>
<dt>
<tt class="descname">2.42532274e-02,   2.47050406e-02,   2.51652705e-02,</tt></dt>
<dt>
<tt class="descname">2.56340741e-02,   2.61116110e-02,   2.65980440e-02,</tt></dt>
<dt>
<tt class="descname">2.70935387e-02,   2.75982639e-02,   2.81123917e-02,</tt></dt>
<dt>
<tt class="descname">2.86360972e-02,   2.91695588e-02,   2.97129582e-02,</tt></dt>
<dt>
<tt class="descname">3.02664806e-02,   3.08303146e-02,   3.14046522e-02,</tt></dt>
<dt>
<tt class="descname">3.19896892e-02,   3.25856248e-02,   3.31926620e-02,</tt></dt>
<dt>
<tt class="descname">3.38110078e-02,   3.44408728e-02,   3.50824714e-02,</tt></dt>
<dt>
<tt class="descname">3.57360225e-02,   3.64017485e-02,   3.70798763e-02,</tt></dt>
<dt>
<tt class="descname">3.77706369e-02,   3.84742658e-02,   3.91910025e-02,</tt></dt>
<dt>
<tt class="descname">3.99210913e-02,   4.06647809e-02,   4.14223247e-02,</tt></dt>
<dt>
<tt class="descname">4.21939808e-02,   4.29800121e-02,   4.37806863e-02,</tt></dt>
<dt>
<tt class="descname">4.45962763e-02,   4.54270599e-02,   4.62733201e-02,</tt></dt>
<dt>
<tt class="descname">4.71353453e-02,   4.80134292e-02,   4.89078709e-02,</tt></dt>
<dt>
<tt class="descname">4.98189752e-02,   5.07470524e-02,   5.16924187e-02,</tt></dt>
<dt>
<tt class="descname">5.26553963e-02,   5.36363132e-02,   5.46355035e-02,</tt></dt>
<dt>
<tt class="descname">5.56533078e-02,   5.66900727e-02,   5.77461515e-02,</tt></dt>
<dt>
<tt class="descname">5.88219040e-02,   5.99176967e-02,   6.10339029e-02,</tt></dt>
<dt>
<tt class="descname">6.21709029e-02,   6.33290840e-02,   6.45088409e-02,</tt></dt>
<dt>
<tt class="descname">6.57105755e-02,   6.69346971e-02,   6.81816229e-02,</tt></dt>
<dt>
<tt class="descname">6.94517777e-02,   7.07455942e-02,   7.20635132e-02,</tt></dt>
<dt>
<tt class="descname">7.34059837e-02,   7.47734631e-02,   7.61664172e-02,</tt></dt>
<dt>
<tt class="descname">7.75853206e-02,   7.90306568e-02,   8.05029181e-02,</tt></dt>
<dt>
<tt class="descname">8.20026062e-02,   8.35302320e-02,   8.50863158e-02,</tt></dt>
<dt>
<tt class="descname">8.66713880e-02,   8.82859884e-02,   8.99306672e-02,</tt></dt>
<dt>
<tt class="descname">9.16059848e-02,   9.33125118e-02,   9.50508296e-02,</tt></dt>
<dt>
<tt class="descname">9.68215306e-02,   9.86252179e-02,   1.00462506e-01,</tt></dt>
<dt>
<tt class="descname">1.02334021e-01,   1.04240401e-01,   1.06182294e-01,</tt></dt>
<dt>
<tt class="descname">1.08160363e-01,   1.10175281e-01,   1.12227736e-01,</tt></dt>
<dt>
<tt class="descname">1.14318425e-01,   1.16448062e-01,   1.18617372e-01,</tt></dt>
<dt>
<tt class="descname">1.20827094e-01,   1.23077980e-01,   1.25370799e-01,</tt></dt>
<dt>
<tt class="descname">1.27706330e-01,   1.30085370e-01,   1.32508729e-01,</tt></dt>
<dt>
<tt class="descname">1.34977233e-01,   1.37491723e-01,   1.40053055e-01,</tt></dt>
<dt>
<tt class="descname">1.42662102e-01,   1.45319752e-01,   1.48026913e-01,</tt></dt>
<dt>
<tt class="descname">1.50784505e-01,   1.53593468e-01,   1.56454759e-01,</tt></dt>
<dt>
<tt class="descname">1.59369353e-01,   1.62338243e-01,   1.65362441e-01,</tt></dt>
<dt>
<tt class="descname">1.68442976e-01,   1.71580899e-01,   1.74777277e-01,</tt></dt>
<dt>
<tt class="descname">1.78033202e-01,   1.81349780e-01,   1.84728144e-01,</tt></dt>
<dt>
<tt class="descname">1.88169442e-01,   1.91674849e-01,   1.95245558e-01,</tt></dt>
<dt>
<tt class="descname">1.98882786e-01,   2.02587771e-01,   2.06361777e-01,</tt></dt>
<dt>
<tt class="descname">2.10206088e-01,   2.14122015e-01,   2.18110892e-01,</tt></dt>
<dt>
<tt class="descname">2.22174078e-01,   2.26312957e-01,   2.30528939e-01,</tt></dt>
<dt>
<tt class="descname">2.34823460e-01,   2.39197984e-01,   2.43654001e-01,</tt></dt>
<dt>
<tt class="descname">2.48193029e-01,   2.52816614e-01,   2.57526333e-01,</tt></dt>
<dt>
<tt class="descname">2.62323788e-01,   2.67210616e-01,   2.72188479e-01,</tt></dt>
<dt>
<tt class="descname">2.77259076e-01,   2.82424133e-01,   2.87685409e-01,</tt></dt>
<dt>
<tt class="descname">2.93044698e-01,   2.98503825e-01,   3.04064649e-01,</tt></dt>
<dt>
<tt class="descname">3.09729067e-01,   3.15499006e-01,   3.21376434e-01,</tt></dt>
<dt>
<tt class="descname">3.27363353e-01,   3.33461802e-01,   3.39673858e-01,</tt></dt>
<dt>
<tt class="descname">3.46001639e-01,   3.52447300e-01,   3.59013038e-01,</tt></dt>
<dt>
<tt class="descname">3.65701088e-01,   3.72513730e-01,   3.79453285e-01,</tt></dt>
<dt>
<tt class="descname">3.86522116e-01,   3.93722633e-01,   4.01057288e-01,</tt></dt>
<dt>
<tt class="descname">4.08528580e-01,   4.16139055e-01,   4.23891306e-01,</tt></dt>
<dt>
<tt class="descname">4.31787973e-01,   4.39831747e-01,   4.48025368e-01,</tt></dt>
<dt>
<tt class="descname">4.56371628e-01,   4.64873371e-01,   4.73533492e-01,</tt></dt>
<dt>
<tt class="descname">4.82354943e-01,   4.91340729e-01,   5.00493910e-01,</tt></dt>
<dt>
<tt class="descname">5.09817606e-01,   5.19314994e-01,   5.28989308e-01,</tt></dt>
<dt>
<tt class="descname">5.38843844e-01,   5.48881961e-01,   5.59107078e-01,</tt></dt>
<dt>
<tt class="descname">5.69522678e-01,   5.80132310e-01,   5.90939590e-01,</tt></dt>
<dt>
<tt class="descname">6.01948197e-01,   6.13161884e-01,   6.24584471e-01,</tt></dt>
<dt>
<tt class="descname">6.36219849e-01,   6.48071983e-01,   6.60144909e-01,</tt></dt>
<dt>
<tt class="descname">6.72442742e-01,   6.84969672e-01,   6.97729965e-01,</tt></dt>
<dt>
<tt class="descname">7.10727970e-01,   7.23968114e-01,   7.37454909e-01,</tt></dt>
<dt>
<tt class="descname">7.51192949e-01,   7.65186915e-01,   7.79441575e-01,</tt></dt>
<dt>
<tt class="descname">7.93961785e-01,   8.08752491e-01,   8.23818733e-01,</tt></dt>
<dt>
<tt class="descname">8.39165644e-01,   8.54798453e-01,   8.70722485e-01,</tt></dt>
<dt>
<tt class="descname">8.86943166e-01,   9.03466021e-01,   9.20296681e-01,</tt></dt>
<dt>
<tt class="descname">9.37440879e-01,   9.54904456e-01,   9.72693362e-01,</tt></dt>
<dt>
<tt class="descname">9.90813657e-01,   1.00927151e+00,   1.02807322e+00,</tt></dt>
<dt>
<tt class="descname">1.04722519e+00,   1.06673394e+00,   1.08660611e+00,</tt></dt>
<dt>
<tt class="descname">1.10684849e+00,   1.12746796e+00,   1.14847155e+00,</tt></dt>
<dt>
<tt class="descname">1.16986641e+00,   1.19165984e+00,   1.21385926e+00,</tt></dt>
<dt>
<tt class="descname">1.23647224e+00,   1.25950646e+00,   1.28296980e+00,</tt></dt>
<dt>
<tt class="descname">1.30687023e+00,   1.33121590e+00,   1.35601511e+00,</tt></dt>
<dt>
<tt class="descname">1.38127630e+00,   1.40700809e+00,   1.43321923e+00,</tt></dt>
<dt>
<tt class="descname">1.45991865e+00,   1.48711546e+00,   1.51481892e+00,</tt></dt>
<dt>
<tt class="descname">1.54303847e+00,   1.57178372e+00,   1.60106446e+00,</tt></dt>
<dt>
<tt class="descname">1.63089068e+00,   1.66127252e+00,   1.69222035e+00,</tt></dt>
<dt>
<tt class="descname">1.72374471e+00,   1.75585633e+00,   1.78856616e+00,</tt></dt>
<dt>
<tt class="descname">1.82188534e+00,   1.85582523e+00,   1.89039738e+00,</tt></dt>
<dt>
<tt class="descname">1.92561357e+00,   1.96148581e+00,   1.99802631e+00,</tt></dt>
<dt>
<tt class="descname">2.03524752e+00,   2.07316213e+00,   2.11178304e+00,</tt></dt>
<dt>
<tt class="descname">2.15112343e+00,   2.19119669e+00,   2.23201647e+00,</tt></dt>
<dt>
<tt class="descname">2.27359668e+00,   2.31595149e+00,   2.35909533e+00,</tt></dt>
<dt>
<tt class="descname">2.40304289e+00,   2.44780916e+00,   2.49340937e+00,</tt></dt>
<dt>
<tt class="descname">2.53985907e+00,   2.58717408e+00,   2.63537052e+00,</tt></dt>
<dt>
<tt class="descname">2.68446481e+00,   2.73447368e+00,   2.78541416e+00,</tt></dt>
<dt>
<tt class="descname">2.83730362e+00,   2.89015972e+00,   2.94400048e+00,</tt></dt>
<dt>
<tt class="descname">2.99884423e+00,   3.05470967e+00,   3.11161583e+00,</tt></dt>
<dt>
<tt class="descname">3.16958209e+00,   3.22862820e+00,   3.28877429e+00,</tt></dt>
<dt>
<tt class="descname">3.35004083e+00,   3.41244871e+00,   3.47601918e+00,</tt></dt>
<dt>
<tt class="descname">3.54077391e+00,   3.60673495e+00,   3.67392478e+00,</tt></dt>
<dt>
<tt class="descname">3.74236629e+00,   3.81208280e+00,   3.88309805e+00,</tt></dt>
<dt>
<tt class="descname">3.95543624e+00,   4.02912203e+00,   4.10418050e+00,</tt></dt>
<dt>
<tt class="descname">4.18063724e+00,   4.25851829e+00,   4.33785019e+00,</tt></dt>
<dt>
<tt class="descname">4.41865996e+00,   4.50097513e+00,   4.58482375e+00,</tt></dt>
<dt>
<tt class="descname">4.67023439e+00,   4.75723614e+00,   4.84585864e+00,</tt></dt>
<dt>
<tt class="descname">4.93613210e+00,   5.02808725e+00,   5.12175544e+00,</tt></dt>
<dt>
<tt class="descname">5.21716858e+00,   5.31435916e+00,   5.41336030e+00,</tt></dt>
<dt>
<tt class="descname">5.51420574e+00,   5.61692982e+00,   5.72156756e+00,</tt></dt>
<dt>
<tt class="descname">5.82815458e+00,   5.93672722e+00,   6.04732245e+00,</tt></dt>
<dt>
<tt class="descname">6.15997796e+00,   6.27473213e+00,   6.39162405e+00,</tt></dt>
<dt>
<tt class="descname">6.51069356e+00,   6.63198120e+00,   6.75552832e+00,</tt></dt>
<dt>
<tt class="descname">6.88137699e+00,   7.00957009e+00,   7.14015130e+00,</tt></dt>
<dt>
<tt class="descname">7.27316511e+00,   7.40865683e+00,   7.54667263e+00,</tt></dt>
<dt>
<tt class="descname">7.68725952e+00,   7.83046540e+00,   7.97633907e+00,</tt></dt>
<dt>
<tt class="descname">8.12493021e+00,   8.27628946e+00,   8.43046837e+00,</tt></dt>
<dt>
<tt class="descname">8.58751948e+00,   8.74749630e+00,   8.91045332e+00,</tt></dt>
<dt>
<tt class="descname">9.07644607e+00,   9.24553110e+00,   9.41776601e+00,</tt></dt>
<dt>
<tt class="descname">9.59320948e+00,   9.77192128e+00,   9.95396231e+00,</tt></dt>
<dt>
<tt class="descname">1.01393946e+01,   1.03282813e+01,   1.05206867e+01,</tt></dt>
<dt>
<tt class="descname">1.07166765e+01,   1.09163173e+01,   1.11196773e+01,</tt></dt>
<dt>
<tt class="descname">1.13268257e+01,   1.15378330e+01,   1.17527712e+01,</tt></dt>
<dt>
<tt class="descname">1.19717134e+01,   1.21947344e+01,   1.24219100e+01,</tt></dt>
<dt>
<tt class="descname">1.26533176e+01,   1.28890361e+01,   1.31291459e+01,</tt></dt>
<dt>
<tt class="descname">1.33737286e+01,   1.36228676e+01,   1.38766479e+01,</tt></dt>
<dt>
<tt class="descname">1.41351558e+01,   1.43984795e+01,   1.46667087e+01,</tt></dt>
<dt>
<tt class="descname">1.49399346e+01,   1.52182505e+01,   1.55017512e+01,</tt></dt>
<dt>
<tt class="descname">1.57905331e+01,   1.60846948e+01,   1.63843365e+01,</tt></dt>
<dt>
<tt class="descname">1.66895601e+01,   1.70004698e+01,   1.73171713e+01,</tt></dt>
<dt>
<tt class="descname">1.76397728e+01,   1.79683839e+01,   1.83031168e+01,</tt></dt>
<dt>
<tt class="descname">1.86440853e+01,   1.89914058e+01,   1.93451965e+01,</tt></dt>
<dt>
<tt class="descname">1.97055780e+01,   2.00726730e+01,   2.04466067e+01,</tt></dt>
<dt>
<tt class="descname">2.08275063e+01,   2.12155017e+01,   2.16107251e+01,</tt></dt>
<dt>
<tt class="descname">2.20133111e+01,   2.24233968e+01,   2.28411221e+01,</tt></dt>
<dt>
<tt class="descname">2.32666291e+01,   2.37000629e+01,   2.41415712e+01,</tt></dt>
<dt>
<tt class="descname">2.45913043e+01,   2.50494154e+01,   2.55160607e+01,</tt></dt>
<dt>
<tt class="descname">2.59913992e+01,   2.64755927e+01,   2.69688063e+01,</tt></dt>
<dt>
<tt class="descname">2.74712079e+01,   2.79829688e+01,   2.85042632e+01,</tt></dt>
<dt>
<tt class="descname">2.90352688e+01,   2.95761666e+01,   3.01271407e+01,</tt></dt>
<dt>
<tt class="descname">3.06883789e+01,   3.12600724e+01,   3.18424160e+01,</tt></dt>
<dt>
<tt class="descname">3.24356081e+01,   3.30398507e+01,   3.36553498e+01,</tt></dt>
<dt>
<tt class="descname">3.42823149e+01,   3.49209598e+01,   3.55715021e+01,</tt></dt>
<dt>
<tt class="descname">3.62341632e+01,   3.69091691e+01,   3.75967497e+01,</tt></dt>
<dt>
<tt class="descname">3.82971391e+01,   3.90105762e+01,   3.97373038e+01,</tt></dt>
<dt>
<tt class="descname">4.04775697e+01,   4.12316259e+01,   4.19997295e+01,</tt></dt>
<dt>
<tt class="descname">4.27821420e+01,   4.35791301e+01,   4.43909653e+01,</tt></dt>
<dt>
<tt class="descname">4.52179242e+01,   4.60602884e+01,   4.69183451e+01,</tt></dt>
<dt>
<tt class="descname">4.77923865e+01,   4.86827104e+01,   4.95896201e+01,</tt></dt>
<dt>
<tt class="descname">5.05134247e+01,   5.14544388e+01,   5.24129830e+01,</tt></dt>
<dt>
<tt class="descname">5.33893840e+01,   5.43839743e+01,   5.53970928e+01,</tt></dt>
<dt>
<tt class="descname">5.64290847e+01,   5.74803016e+01,   5.85511016e+01,</tt></dt>
<dt>
<tt class="descname">5.96418495e+01,   6.07529169e+01,   6.18846824e+01,</tt></dt>
<dt>
<tt class="descname">6.30375315e+01,   6.42118571e+01,   6.54080591e+01,</tt></dt>
<dt>
<tt class="descname">6.66265452e+01,   6.78677305e+01,   6.91320378e+01,</tt></dt>
<dt>
<tt class="descname">7.04198979e+01,   7.17317494e+01,   7.30680395e+01,</tt></dt>
<dt>
<tt class="descname">7.44292233e+01,   7.58157646e+01,   7.72281357e+01,</tt></dt>
<dt>
<tt class="descname">7.86668179e+01,   8.01323013e+01,   8.16250851e+01,</tt></dt>
<dt>
<tt class="descname">8.31456781e+01,   8.46945981e+01,   8.62723729e+01,</tt></dt>
<dt>
<tt class="descname">8.78795401e+01,   8.95166472e+01,   9.11842520e+01,</tt></dt>
<dt>
<tt class="descname">9.28829225e+01,   9.46132376e+01,   9.63757866e+01,</tt></dt>
<dt>
<tt class="descname">9.81711702e+01,   1.00000000e+02]))</tt></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<tt class="descname">integrate(fn=&lt;function kroupa at 0x10e2b3050&gt;, bins=array([  1.00000000e-02,   1.01862899e-02,   1.03760502e-02,</tt></dt>
<dt>
<tt class="descname">1.05693455e-02,   1.07662418e-02,   1.09668060e-02,</tt></dt>
<dt>
<tt class="descname">1.11711065e-02,   1.13792129e-02,   1.15911962e-02,</tt></dt>
<dt>
<tt class="descname">1.18071285e-02,   1.20270833e-02,   1.22511358e-02,</tt></dt>
<dt>
<tt class="descname">1.24793621e-02,   1.27118400e-02,   1.29486487e-02,</tt></dt>
<dt>
<tt class="descname">1.31898690e-02,   1.34355829e-02,   1.36858742e-02,</tt></dt>
<dt>
<tt class="descname">1.39408283e-02,   1.42005318e-02,   1.44650734e-02,</tt></dt>
<dt>
<tt class="descname">1.47345431e-02,   1.50090328e-02,   1.52886359e-02,</tt></dt>
<dt>
<tt class="descname">1.55734477e-02,   1.58635653e-02,   1.61590875e-02,</tt></dt>
<dt>
<tt class="descname">1.64601150e-02,   1.67667503e-02,   1.70790980e-02,</tt></dt>
<dt>
<tt class="descname">1.73972643e-02,   1.77213578e-02,   1.80514888e-02,</tt></dt>
<dt>
<tt class="descname">1.83877698e-02,   1.87303154e-02,   1.90792422e-02,</tt></dt>
<dt>
<tt class="descname">1.94346693e-02,   1.97967175e-02,   2.01655104e-02,</tt></dt>
<dt>
<tt class="descname">2.05411735e-02,   2.09238348e-02,   2.13136247e-02,</tt></dt>
<dt>
<tt class="descname">2.17106760e-02,   2.21151240e-02,   2.25271064e-02,</tt></dt>
<dt>
<tt class="descname">2.29467637e-02,   2.33742387e-02,   2.38096772e-02,</tt></dt>
<dt>
<tt class="descname">2.42532274e-02,   2.47050406e-02,   2.51652705e-02,</tt></dt>
<dt>
<tt class="descname">2.56340741e-02,   2.61116110e-02,   2.65980440e-02,</tt></dt>
<dt>
<tt class="descname">2.70935387e-02,   2.75982639e-02,   2.81123917e-02,</tt></dt>
<dt>
<tt class="descname">2.86360972e-02,   2.91695588e-02,   2.97129582e-02,</tt></dt>
<dt>
<tt class="descname">3.02664806e-02,   3.08303146e-02,   3.14046522e-02,</tt></dt>
<dt>
<tt class="descname">3.19896892e-02,   3.25856248e-02,   3.31926620e-02,</tt></dt>
<dt>
<tt class="descname">3.38110078e-02,   3.44408728e-02,   3.50824714e-02,</tt></dt>
<dt>
<tt class="descname">3.57360225e-02,   3.64017485e-02,   3.70798763e-02,</tt></dt>
<dt>
<tt class="descname">3.77706369e-02,   3.84742658e-02,   3.91910025e-02,</tt></dt>
<dt>
<tt class="descname">3.99210913e-02,   4.06647809e-02,   4.14223247e-02,</tt></dt>
<dt>
<tt class="descname">4.21939808e-02,   4.29800121e-02,   4.37806863e-02,</tt></dt>
<dt>
<tt class="descname">4.45962763e-02,   4.54270599e-02,   4.62733201e-02,</tt></dt>
<dt>
<tt class="descname">4.71353453e-02,   4.80134292e-02,   4.89078709e-02,</tt></dt>
<dt>
<tt class="descname">4.98189752e-02,   5.07470524e-02,   5.16924187e-02,</tt></dt>
<dt>
<tt class="descname">5.26553963e-02,   5.36363132e-02,   5.46355035e-02,</tt></dt>
<dt>
<tt class="descname">5.56533078e-02,   5.66900727e-02,   5.77461515e-02,</tt></dt>
<dt>
<tt class="descname">5.88219040e-02,   5.99176967e-02,   6.10339029e-02,</tt></dt>
<dt>
<tt class="descname">6.21709029e-02,   6.33290840e-02,   6.45088409e-02,</tt></dt>
<dt>
<tt class="descname">6.57105755e-02,   6.69346971e-02,   6.81816229e-02,</tt></dt>
<dt>
<tt class="descname">6.94517777e-02,   7.07455942e-02,   7.20635132e-02,</tt></dt>
<dt>
<tt class="descname">7.34059837e-02,   7.47734631e-02,   7.61664172e-02,</tt></dt>
<dt>
<tt class="descname">7.75853206e-02,   7.90306568e-02,   8.05029181e-02,</tt></dt>
<dt>
<tt class="descname">8.20026062e-02,   8.35302320e-02,   8.50863158e-02,</tt></dt>
<dt>
<tt class="descname">8.66713880e-02,   8.82859884e-02,   8.99306672e-02,</tt></dt>
<dt>
<tt class="descname">9.16059848e-02,   9.33125118e-02,   9.50508296e-02,</tt></dt>
<dt>
<tt class="descname">9.68215306e-02,   9.86252179e-02,   1.00462506e-01,</tt></dt>
<dt>
<tt class="descname">1.02334021e-01,   1.04240401e-01,   1.06182294e-01,</tt></dt>
<dt>
<tt class="descname">1.08160363e-01,   1.10175281e-01,   1.12227736e-01,</tt></dt>
<dt>
<tt class="descname">1.14318425e-01,   1.16448062e-01,   1.18617372e-01,</tt></dt>
<dt>
<tt class="descname">1.20827094e-01,   1.23077980e-01,   1.25370799e-01,</tt></dt>
<dt>
<tt class="descname">1.27706330e-01,   1.30085370e-01,   1.32508729e-01,</tt></dt>
<dt>
<tt class="descname">1.34977233e-01,   1.37491723e-01,   1.40053055e-01,</tt></dt>
<dt>
<tt class="descname">1.42662102e-01,   1.45319752e-01,   1.48026913e-01,</tt></dt>
<dt>
<tt class="descname">1.50784505e-01,   1.53593468e-01,   1.56454759e-01,</tt></dt>
<dt>
<tt class="descname">1.59369353e-01,   1.62338243e-01,   1.65362441e-01,</tt></dt>
<dt>
<tt class="descname">1.68442976e-01,   1.71580899e-01,   1.74777277e-01,</tt></dt>
<dt>
<tt class="descname">1.78033202e-01,   1.81349780e-01,   1.84728144e-01,</tt></dt>
<dt>
<tt class="descname">1.88169442e-01,   1.91674849e-01,   1.95245558e-01,</tt></dt>
<dt>
<tt class="descname">1.98882786e-01,   2.02587771e-01,   2.06361777e-01,</tt></dt>
<dt>
<tt class="descname">2.10206088e-01,   2.14122015e-01,   2.18110892e-01,</tt></dt>
<dt>
<tt class="descname">2.22174078e-01,   2.26312957e-01,   2.30528939e-01,</tt></dt>
<dt>
<tt class="descname">2.34823460e-01,   2.39197984e-01,   2.43654001e-01,</tt></dt>
<dt>
<tt class="descname">2.48193029e-01,   2.52816614e-01,   2.57526333e-01,</tt></dt>
<dt>
<tt class="descname">2.62323788e-01,   2.67210616e-01,   2.72188479e-01,</tt></dt>
<dt>
<tt class="descname">2.77259076e-01,   2.82424133e-01,   2.87685409e-01,</tt></dt>
<dt>
<tt class="descname">2.93044698e-01,   2.98503825e-01,   3.04064649e-01,</tt></dt>
<dt>
<tt class="descname">3.09729067e-01,   3.15499006e-01,   3.21376434e-01,</tt></dt>
<dt>
<tt class="descname">3.27363353e-01,   3.33461802e-01,   3.39673858e-01,</tt></dt>
<dt>
<tt class="descname">3.46001639e-01,   3.52447300e-01,   3.59013038e-01,</tt></dt>
<dt>
<tt class="descname">3.65701088e-01,   3.72513730e-01,   3.79453285e-01,</tt></dt>
<dt>
<tt class="descname">3.86522116e-01,   3.93722633e-01,   4.01057288e-01,</tt></dt>
<dt>
<tt class="descname">4.08528580e-01,   4.16139055e-01,   4.23891306e-01,</tt></dt>
<dt>
<tt class="descname">4.31787973e-01,   4.39831747e-01,   4.48025368e-01,</tt></dt>
<dt>
<tt class="descname">4.56371628e-01,   4.64873371e-01,   4.73533492e-01,</tt></dt>
<dt>
<tt class="descname">4.82354943e-01,   4.91340729e-01,   5.00493910e-01,</tt></dt>
<dt>
<tt class="descname">5.09817606e-01,   5.19314994e-01,   5.28989308e-01,</tt></dt>
<dt>
<tt class="descname">5.38843844e-01,   5.48881961e-01,   5.59107078e-01,</tt></dt>
<dt>
<tt class="descname">5.69522678e-01,   5.80132310e-01,   5.90939590e-01,</tt></dt>
<dt>
<tt class="descname">6.01948197e-01,   6.13161884e-01,   6.24584471e-01,</tt></dt>
<dt>
<tt class="descname">6.36219849e-01,   6.48071983e-01,   6.60144909e-01,</tt></dt>
<dt>
<tt class="descname">6.72442742e-01,   6.84969672e-01,   6.97729965e-01,</tt></dt>
<dt>
<tt class="descname">7.10727970e-01,   7.23968114e-01,   7.37454909e-01,</tt></dt>
<dt>
<tt class="descname">7.51192949e-01,   7.65186915e-01,   7.79441575e-01,</tt></dt>
<dt>
<tt class="descname">7.93961785e-01,   8.08752491e-01,   8.23818733e-01,</tt></dt>
<dt>
<tt class="descname">8.39165644e-01,   8.54798453e-01,   8.70722485e-01,</tt></dt>
<dt>
<tt class="descname">8.86943166e-01,   9.03466021e-01,   9.20296681e-01,</tt></dt>
<dt>
<tt class="descname">9.37440879e-01,   9.54904456e-01,   9.72693362e-01,</tt></dt>
<dt>
<tt class="descname">9.90813657e-01,   1.00927151e+00,   1.02807322e+00,</tt></dt>
<dt>
<tt class="descname">1.04722519e+00,   1.06673394e+00,   1.08660611e+00,</tt></dt>
<dt>
<tt class="descname">1.10684849e+00,   1.12746796e+00,   1.14847155e+00,</tt></dt>
<dt>
<tt class="descname">1.16986641e+00,   1.19165984e+00,   1.21385926e+00,</tt></dt>
<dt>
<tt class="descname">1.23647224e+00,   1.25950646e+00,   1.28296980e+00,</tt></dt>
<dt>
<tt class="descname">1.30687023e+00,   1.33121590e+00,   1.35601511e+00,</tt></dt>
<dt>
<tt class="descname">1.38127630e+00,   1.40700809e+00,   1.43321923e+00,</tt></dt>
<dt>
<tt class="descname">1.45991865e+00,   1.48711546e+00,   1.51481892e+00,</tt></dt>
<dt>
<tt class="descname">1.54303847e+00,   1.57178372e+00,   1.60106446e+00,</tt></dt>
<dt>
<tt class="descname">1.63089068e+00,   1.66127252e+00,   1.69222035e+00,</tt></dt>
<dt>
<tt class="descname">1.72374471e+00,   1.75585633e+00,   1.78856616e+00,</tt></dt>
<dt>
<tt class="descname">1.82188534e+00,   1.85582523e+00,   1.89039738e+00,</tt></dt>
<dt>
<tt class="descname">1.92561357e+00,   1.96148581e+00,   1.99802631e+00,</tt></dt>
<dt>
<tt class="descname">2.03524752e+00,   2.07316213e+00,   2.11178304e+00,</tt></dt>
<dt>
<tt class="descname">2.15112343e+00,   2.19119669e+00,   2.23201647e+00,</tt></dt>
<dt>
<tt class="descname">2.27359668e+00,   2.31595149e+00,   2.35909533e+00,</tt></dt>
<dt>
<tt class="descname">2.40304289e+00,   2.44780916e+00,   2.49340937e+00,</tt></dt>
<dt>
<tt class="descname">2.53985907e+00,   2.58717408e+00,   2.63537052e+00,</tt></dt>
<dt>
<tt class="descname">2.68446481e+00,   2.73447368e+00,   2.78541416e+00,</tt></dt>
<dt>
<tt class="descname">2.83730362e+00,   2.89015972e+00,   2.94400048e+00,</tt></dt>
<dt>
<tt class="descname">2.99884423e+00,   3.05470967e+00,   3.11161583e+00,</tt></dt>
<dt>
<tt class="descname">3.16958209e+00,   3.22862820e+00,   3.28877429e+00,</tt></dt>
<dt>
<tt class="descname">3.35004083e+00,   3.41244871e+00,   3.47601918e+00,</tt></dt>
<dt>
<tt class="descname">3.54077391e+00,   3.60673495e+00,   3.67392478e+00,</tt></dt>
<dt>
<tt class="descname">3.74236629e+00,   3.81208280e+00,   3.88309805e+00,</tt></dt>
<dt>
<tt class="descname">3.95543624e+00,   4.02912203e+00,   4.10418050e+00,</tt></dt>
<dt>
<tt class="descname">4.18063724e+00,   4.25851829e+00,   4.33785019e+00,</tt></dt>
<dt>
<tt class="descname">4.41865996e+00,   4.50097513e+00,   4.58482375e+00,</tt></dt>
<dt>
<tt class="descname">4.67023439e+00,   4.75723614e+00,   4.84585864e+00,</tt></dt>
<dt>
<tt class="descname">4.93613210e+00,   5.02808725e+00,   5.12175544e+00,</tt></dt>
<dt>
<tt class="descname">5.21716858e+00,   5.31435916e+00,   5.41336030e+00,</tt></dt>
<dt>
<tt class="descname">5.51420574e+00,   5.61692982e+00,   5.72156756e+00,</tt></dt>
<dt>
<tt class="descname">5.82815458e+00,   5.93672722e+00,   6.04732245e+00,</tt></dt>
<dt>
<tt class="descname">6.15997796e+00,   6.27473213e+00,   6.39162405e+00,</tt></dt>
<dt>
<tt class="descname">6.51069356e+00,   6.63198120e+00,   6.75552832e+00,</tt></dt>
<dt>
<tt class="descname">6.88137699e+00,   7.00957009e+00,   7.14015130e+00,</tt></dt>
<dt>
<tt class="descname">7.27316511e+00,   7.40865683e+00,   7.54667263e+00,</tt></dt>
<dt>
<tt class="descname">7.68725952e+00,   7.83046540e+00,   7.97633907e+00,</tt></dt>
<dt>
<tt class="descname">8.12493021e+00,   8.27628946e+00,   8.43046837e+00,</tt></dt>
<dt>
<tt class="descname">8.58751948e+00,   8.74749630e+00,   8.91045332e+00,</tt></dt>
<dt>
<tt class="descname">9.07644607e+00,   9.24553110e+00,   9.41776601e+00,</tt></dt>
<dt>
<tt class="descname">9.59320948e+00,   9.77192128e+00,   9.95396231e+00,</tt></dt>
<dt>
<tt class="descname">1.01393946e+01,   1.03282813e+01,   1.05206867e+01,</tt></dt>
<dt>
<tt class="descname">1.07166765e+01,   1.09163173e+01,   1.11196773e+01,</tt></dt>
<dt>
<tt class="descname">1.13268257e+01,   1.15378330e+01,   1.17527712e+01,</tt></dt>
<dt>
<tt class="descname">1.19717134e+01,   1.21947344e+01,   1.24219100e+01,</tt></dt>
<dt>
<tt class="descname">1.26533176e+01,   1.28890361e+01,   1.31291459e+01,</tt></dt>
<dt>
<tt class="descname">1.33737286e+01,   1.36228676e+01,   1.38766479e+01,</tt></dt>
<dt>
<tt class="descname">1.41351558e+01,   1.43984795e+01,   1.46667087e+01,</tt></dt>
<dt>
<tt class="descname">1.49399346e+01,   1.52182505e+01,   1.55017512e+01,</tt></dt>
<dt>
<tt class="descname">1.57905331e+01,   1.60846948e+01,   1.63843365e+01,</tt></dt>
<dt>
<tt class="descname">1.66895601e+01,   1.70004698e+01,   1.73171713e+01,</tt></dt>
<dt>
<tt class="descname">1.76397728e+01,   1.79683839e+01,   1.83031168e+01,</tt></dt>
<dt>
<tt class="descname">1.86440853e+01,   1.89914058e+01,   1.93451965e+01,</tt></dt>
<dt>
<tt class="descname">1.97055780e+01,   2.00726730e+01,   2.04466067e+01,</tt></dt>
<dt>
<tt class="descname">2.08275063e+01,   2.12155017e+01,   2.16107251e+01,</tt></dt>
<dt>
<tt class="descname">2.20133111e+01,   2.24233968e+01,   2.28411221e+01,</tt></dt>
<dt>
<tt class="descname">2.32666291e+01,   2.37000629e+01,   2.41415712e+01,</tt></dt>
<dt>
<tt class="descname">2.45913043e+01,   2.50494154e+01,   2.55160607e+01,</tt></dt>
<dt>
<tt class="descname">2.59913992e+01,   2.64755927e+01,   2.69688063e+01,</tt></dt>
<dt>
<tt class="descname">2.74712079e+01,   2.79829688e+01,   2.85042632e+01,</tt></dt>
<dt>
<tt class="descname">2.90352688e+01,   2.95761666e+01,   3.01271407e+01,</tt></dt>
<dt>
<tt class="descname">3.06883789e+01,   3.12600724e+01,   3.18424160e+01,</tt></dt>
<dt>
<tt class="descname">3.24356081e+01,   3.30398507e+01,   3.36553498e+01,</tt></dt>
<dt>
<tt class="descname">3.42823149e+01,   3.49209598e+01,   3.55715021e+01,</tt></dt>
<dt>
<tt class="descname">3.62341632e+01,   3.69091691e+01,   3.75967497e+01,</tt></dt>
<dt>
<tt class="descname">3.82971391e+01,   3.90105762e+01,   3.97373038e+01,</tt></dt>
<dt>
<tt class="descname">4.04775697e+01,   4.12316259e+01,   4.19997295e+01,</tt></dt>
<dt>
<tt class="descname">4.27821420e+01,   4.35791301e+01,   4.43909653e+01,</tt></dt>
<dt>
<tt class="descname">4.52179242e+01,   4.60602884e+01,   4.69183451e+01,</tt></dt>
<dt>
<tt class="descname">4.77923865e+01,   4.86827104e+01,   4.95896201e+01,</tt></dt>
<dt>
<tt class="descname">5.05134247e+01,   5.14544388e+01,   5.24129830e+01,</tt></dt>
<dt>
<tt class="descname">5.33893840e+01,   5.43839743e+01,   5.53970928e+01,</tt></dt>
<dt>
<tt class="descname">5.64290847e+01,   5.74803016e+01,   5.85511016e+01,</tt></dt>
<dt>
<tt class="descname">5.96418495e+01,   6.07529169e+01,   6.18846824e+01,</tt></dt>
<dt>
<tt class="descname">6.30375315e+01,   6.42118571e+01,   6.54080591e+01,</tt></dt>
<dt>
<tt class="descname">6.66265452e+01,   6.78677305e+01,   6.91320378e+01,</tt></dt>
<dt>
<tt class="descname">7.04198979e+01,   7.17317494e+01,   7.30680395e+01,</tt></dt>
<dt>
<tt class="descname">7.44292233e+01,   7.58157646e+01,   7.72281357e+01,</tt></dt>
<dt>
<tt class="descname">7.86668179e+01,   8.01323013e+01,   8.16250851e+01,</tt></dt>
<dt>
<tt class="descname">8.31456781e+01,   8.46945981e+01,   8.62723729e+01,</tt></dt>
<dt>
<tt class="descname">8.78795401e+01,   8.95166472e+01,   9.11842520e+01,</tt></dt>
<dt>
<tt class="descname">9.28829225e+01,   9.46132376e+01,   9.63757866e+01,</tt></dt>
<dt>
<tt class="descname">9.81711702e+01,   1.00000000e+02]))</tt></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.imf.inverse_imf">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">inverse_imf</tt><big>(</big><em>p</em>, <em>nbins=1000</em>, <em>mmin=0.029999999999999999</em>, <em>mmax=120</em>, <em>massfunc='kroupa'</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#inverse_imf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.inverse_imf" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse mass function</p>
<p>massfunc can be &#8216;kroupa&#8217;, &#8216;chabrier&#8217;, &#8216;salpeter&#8217;, &#8216;schechter&#8217;, or a function</p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.kroupa">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">kroupa</tt><big>(</big><em>m</em>, <em>integral=False</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#kroupa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.kroupa" title="Permalink to this definition">¶</a></dt>
<dd><p>Kroupa 2001 IMF (<a class="reference external" href="http://arxiv.org/abs/astro-ph/0009005">http://arxiv.org/abs/astro-ph/0009005</a>, <a class="reference external" href="http://adsabs.harvard.edu/abs/2001MNRAS.322..231K">http://adsabs.harvard.edu/abs/2001MNRAS.322..231K</a>)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.lyc_of_cluster">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">lyc_of_cluster</tt><big>(</big><em>masses</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#lyc_of_cluster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.lyc_of_cluster" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine the log of the integrated lyman continuum luminosity of a cluster
Only M&gt;=8msun count</p>
<p>masses is a list or array of masses.</p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.lyc_of_star">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">lyc_of_star</tt><big>(</big><em>mass</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#lyc_of_star"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.lyc_of_star" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine lyman continuum luminosity of a star given its mass
Uses the Vacca, Garmany, Shull 1996 Table 5 Log Q and Mspec parameters</p>
<p>returns LogQ</p>
</dd></dl>

<dl class="function">
<dt>
<tt class="descname">m_cumint(fn=&lt;function kroupa at 0x10e2b3050&gt;, bins=array([  1.00000000e-02,   1.01862899e-02,   1.03760502e-02,</tt></dt>
<dt>
<tt class="descname">1.05693455e-02,   1.07662418e-02,   1.09668060e-02,</tt></dt>
<dt>
<tt class="descname">1.11711065e-02,   1.13792129e-02,   1.15911962e-02,</tt></dt>
<dt>
<tt class="descname">1.18071285e-02,   1.20270833e-02,   1.22511358e-02,</tt></dt>
<dt>
<tt class="descname">1.24793621e-02,   1.27118400e-02,   1.29486487e-02,</tt></dt>
<dt>
<tt class="descname">1.31898690e-02,   1.34355829e-02,   1.36858742e-02,</tt></dt>
<dt>
<tt class="descname">1.39408283e-02,   1.42005318e-02,   1.44650734e-02,</tt></dt>
<dt>
<tt class="descname">1.47345431e-02,   1.50090328e-02,   1.52886359e-02,</tt></dt>
<dt>
<tt class="descname">1.55734477e-02,   1.58635653e-02,   1.61590875e-02,</tt></dt>
<dt>
<tt class="descname">1.64601150e-02,   1.67667503e-02,   1.70790980e-02,</tt></dt>
<dt>
<tt class="descname">1.73972643e-02,   1.77213578e-02,   1.80514888e-02,</tt></dt>
<dt>
<tt class="descname">1.83877698e-02,   1.87303154e-02,   1.90792422e-02,</tt></dt>
<dt>
<tt class="descname">1.94346693e-02,   1.97967175e-02,   2.01655104e-02,</tt></dt>
<dt>
<tt class="descname">2.05411735e-02,   2.09238348e-02,   2.13136247e-02,</tt></dt>
<dt>
<tt class="descname">2.17106760e-02,   2.21151240e-02,   2.25271064e-02,</tt></dt>
<dt>
<tt class="descname">2.29467637e-02,   2.33742387e-02,   2.38096772e-02,</tt></dt>
<dt>
<tt class="descname">2.42532274e-02,   2.47050406e-02,   2.51652705e-02,</tt></dt>
<dt>
<tt class="descname">2.56340741e-02,   2.61116110e-02,   2.65980440e-02,</tt></dt>
<dt>
<tt class="descname">2.70935387e-02,   2.75982639e-02,   2.81123917e-02,</tt></dt>
<dt>
<tt class="descname">2.86360972e-02,   2.91695588e-02,   2.97129582e-02,</tt></dt>
<dt>
<tt class="descname">3.02664806e-02,   3.08303146e-02,   3.14046522e-02,</tt></dt>
<dt>
<tt class="descname">3.19896892e-02,   3.25856248e-02,   3.31926620e-02,</tt></dt>
<dt>
<tt class="descname">3.38110078e-02,   3.44408728e-02,   3.50824714e-02,</tt></dt>
<dt>
<tt class="descname">3.57360225e-02,   3.64017485e-02,   3.70798763e-02,</tt></dt>
<dt>
<tt class="descname">3.77706369e-02,   3.84742658e-02,   3.91910025e-02,</tt></dt>
<dt>
<tt class="descname">3.99210913e-02,   4.06647809e-02,   4.14223247e-02,</tt></dt>
<dt>
<tt class="descname">4.21939808e-02,   4.29800121e-02,   4.37806863e-02,</tt></dt>
<dt>
<tt class="descname">4.45962763e-02,   4.54270599e-02,   4.62733201e-02,</tt></dt>
<dt>
<tt class="descname">4.71353453e-02,   4.80134292e-02,   4.89078709e-02,</tt></dt>
<dt>
<tt class="descname">4.98189752e-02,   5.07470524e-02,   5.16924187e-02,</tt></dt>
<dt>
<tt class="descname">5.26553963e-02,   5.36363132e-02,   5.46355035e-02,</tt></dt>
<dt>
<tt class="descname">5.56533078e-02,   5.66900727e-02,   5.77461515e-02,</tt></dt>
<dt>
<tt class="descname">5.88219040e-02,   5.99176967e-02,   6.10339029e-02,</tt></dt>
<dt>
<tt class="descname">6.21709029e-02,   6.33290840e-02,   6.45088409e-02,</tt></dt>
<dt>
<tt class="descname">6.57105755e-02,   6.69346971e-02,   6.81816229e-02,</tt></dt>
<dt>
<tt class="descname">6.94517777e-02,   7.07455942e-02,   7.20635132e-02,</tt></dt>
<dt>
<tt class="descname">7.34059837e-02,   7.47734631e-02,   7.61664172e-02,</tt></dt>
<dt>
<tt class="descname">7.75853206e-02,   7.90306568e-02,   8.05029181e-02,</tt></dt>
<dt>
<tt class="descname">8.20026062e-02,   8.35302320e-02,   8.50863158e-02,</tt></dt>
<dt>
<tt class="descname">8.66713880e-02,   8.82859884e-02,   8.99306672e-02,</tt></dt>
<dt>
<tt class="descname">9.16059848e-02,   9.33125118e-02,   9.50508296e-02,</tt></dt>
<dt>
<tt class="descname">9.68215306e-02,   9.86252179e-02,   1.00462506e-01,</tt></dt>
<dt>
<tt class="descname">1.02334021e-01,   1.04240401e-01,   1.06182294e-01,</tt></dt>
<dt>
<tt class="descname">1.08160363e-01,   1.10175281e-01,   1.12227736e-01,</tt></dt>
<dt>
<tt class="descname">1.14318425e-01,   1.16448062e-01,   1.18617372e-01,</tt></dt>
<dt>
<tt class="descname">1.20827094e-01,   1.23077980e-01,   1.25370799e-01,</tt></dt>
<dt>
<tt class="descname">1.27706330e-01,   1.30085370e-01,   1.32508729e-01,</tt></dt>
<dt>
<tt class="descname">1.34977233e-01,   1.37491723e-01,   1.40053055e-01,</tt></dt>
<dt>
<tt class="descname">1.42662102e-01,   1.45319752e-01,   1.48026913e-01,</tt></dt>
<dt>
<tt class="descname">1.50784505e-01,   1.53593468e-01,   1.56454759e-01,</tt></dt>
<dt>
<tt class="descname">1.59369353e-01,   1.62338243e-01,   1.65362441e-01,</tt></dt>
<dt>
<tt class="descname">1.68442976e-01,   1.71580899e-01,   1.74777277e-01,</tt></dt>
<dt>
<tt class="descname">1.78033202e-01,   1.81349780e-01,   1.84728144e-01,</tt></dt>
<dt>
<tt class="descname">1.88169442e-01,   1.91674849e-01,   1.95245558e-01,</tt></dt>
<dt>
<tt class="descname">1.98882786e-01,   2.02587771e-01,   2.06361777e-01,</tt></dt>
<dt>
<tt class="descname">2.10206088e-01,   2.14122015e-01,   2.18110892e-01,</tt></dt>
<dt>
<tt class="descname">2.22174078e-01,   2.26312957e-01,   2.30528939e-01,</tt></dt>
<dt>
<tt class="descname">2.34823460e-01,   2.39197984e-01,   2.43654001e-01,</tt></dt>
<dt>
<tt class="descname">2.48193029e-01,   2.52816614e-01,   2.57526333e-01,</tt></dt>
<dt>
<tt class="descname">2.62323788e-01,   2.67210616e-01,   2.72188479e-01,</tt></dt>
<dt>
<tt class="descname">2.77259076e-01,   2.82424133e-01,   2.87685409e-01,</tt></dt>
<dt>
<tt class="descname">2.93044698e-01,   2.98503825e-01,   3.04064649e-01,</tt></dt>
<dt>
<tt class="descname">3.09729067e-01,   3.15499006e-01,   3.21376434e-01,</tt></dt>
<dt>
<tt class="descname">3.27363353e-01,   3.33461802e-01,   3.39673858e-01,</tt></dt>
<dt>
<tt class="descname">3.46001639e-01,   3.52447300e-01,   3.59013038e-01,</tt></dt>
<dt>
<tt class="descname">3.65701088e-01,   3.72513730e-01,   3.79453285e-01,</tt></dt>
<dt>
<tt class="descname">3.86522116e-01,   3.93722633e-01,   4.01057288e-01,</tt></dt>
<dt>
<tt class="descname">4.08528580e-01,   4.16139055e-01,   4.23891306e-01,</tt></dt>
<dt>
<tt class="descname">4.31787973e-01,   4.39831747e-01,   4.48025368e-01,</tt></dt>
<dt>
<tt class="descname">4.56371628e-01,   4.64873371e-01,   4.73533492e-01,</tt></dt>
<dt>
<tt class="descname">4.82354943e-01,   4.91340729e-01,   5.00493910e-01,</tt></dt>
<dt>
<tt class="descname">5.09817606e-01,   5.19314994e-01,   5.28989308e-01,</tt></dt>
<dt>
<tt class="descname">5.38843844e-01,   5.48881961e-01,   5.59107078e-01,</tt></dt>
<dt>
<tt class="descname">5.69522678e-01,   5.80132310e-01,   5.90939590e-01,</tt></dt>
<dt>
<tt class="descname">6.01948197e-01,   6.13161884e-01,   6.24584471e-01,</tt></dt>
<dt>
<tt class="descname">6.36219849e-01,   6.48071983e-01,   6.60144909e-01,</tt></dt>
<dt>
<tt class="descname">6.72442742e-01,   6.84969672e-01,   6.97729965e-01,</tt></dt>
<dt>
<tt class="descname">7.10727970e-01,   7.23968114e-01,   7.37454909e-01,</tt></dt>
<dt>
<tt class="descname">7.51192949e-01,   7.65186915e-01,   7.79441575e-01,</tt></dt>
<dt>
<tt class="descname">7.93961785e-01,   8.08752491e-01,   8.23818733e-01,</tt></dt>
<dt>
<tt class="descname">8.39165644e-01,   8.54798453e-01,   8.70722485e-01,</tt></dt>
<dt>
<tt class="descname">8.86943166e-01,   9.03466021e-01,   9.20296681e-01,</tt></dt>
<dt>
<tt class="descname">9.37440879e-01,   9.54904456e-01,   9.72693362e-01,</tt></dt>
<dt>
<tt class="descname">9.90813657e-01,   1.00927151e+00,   1.02807322e+00,</tt></dt>
<dt>
<tt class="descname">1.04722519e+00,   1.06673394e+00,   1.08660611e+00,</tt></dt>
<dt>
<tt class="descname">1.10684849e+00,   1.12746796e+00,   1.14847155e+00,</tt></dt>
<dt>
<tt class="descname">1.16986641e+00,   1.19165984e+00,   1.21385926e+00,</tt></dt>
<dt>
<tt class="descname">1.23647224e+00,   1.25950646e+00,   1.28296980e+00,</tt></dt>
<dt>
<tt class="descname">1.30687023e+00,   1.33121590e+00,   1.35601511e+00,</tt></dt>
<dt>
<tt class="descname">1.38127630e+00,   1.40700809e+00,   1.43321923e+00,</tt></dt>
<dt>
<tt class="descname">1.45991865e+00,   1.48711546e+00,   1.51481892e+00,</tt></dt>
<dt>
<tt class="descname">1.54303847e+00,   1.57178372e+00,   1.60106446e+00,</tt></dt>
<dt>
<tt class="descname">1.63089068e+00,   1.66127252e+00,   1.69222035e+00,</tt></dt>
<dt>
<tt class="descname">1.72374471e+00,   1.75585633e+00,   1.78856616e+00,</tt></dt>
<dt>
<tt class="descname">1.82188534e+00,   1.85582523e+00,   1.89039738e+00,</tt></dt>
<dt>
<tt class="descname">1.92561357e+00,   1.96148581e+00,   1.99802631e+00,</tt></dt>
<dt>
<tt class="descname">2.03524752e+00,   2.07316213e+00,   2.11178304e+00,</tt></dt>
<dt>
<tt class="descname">2.15112343e+00,   2.19119669e+00,   2.23201647e+00,</tt></dt>
<dt>
<tt class="descname">2.27359668e+00,   2.31595149e+00,   2.35909533e+00,</tt></dt>
<dt>
<tt class="descname">2.40304289e+00,   2.44780916e+00,   2.49340937e+00,</tt></dt>
<dt>
<tt class="descname">2.53985907e+00,   2.58717408e+00,   2.63537052e+00,</tt></dt>
<dt>
<tt class="descname">2.68446481e+00,   2.73447368e+00,   2.78541416e+00,</tt></dt>
<dt>
<tt class="descname">2.83730362e+00,   2.89015972e+00,   2.94400048e+00,</tt></dt>
<dt>
<tt class="descname">2.99884423e+00,   3.05470967e+00,   3.11161583e+00,</tt></dt>
<dt>
<tt class="descname">3.16958209e+00,   3.22862820e+00,   3.28877429e+00,</tt></dt>
<dt>
<tt class="descname">3.35004083e+00,   3.41244871e+00,   3.47601918e+00,</tt></dt>
<dt>
<tt class="descname">3.54077391e+00,   3.60673495e+00,   3.67392478e+00,</tt></dt>
<dt>
<tt class="descname">3.74236629e+00,   3.81208280e+00,   3.88309805e+00,</tt></dt>
<dt>
<tt class="descname">3.95543624e+00,   4.02912203e+00,   4.10418050e+00,</tt></dt>
<dt>
<tt class="descname">4.18063724e+00,   4.25851829e+00,   4.33785019e+00,</tt></dt>
<dt>
<tt class="descname">4.41865996e+00,   4.50097513e+00,   4.58482375e+00,</tt></dt>
<dt>
<tt class="descname">4.67023439e+00,   4.75723614e+00,   4.84585864e+00,</tt></dt>
<dt>
<tt class="descname">4.93613210e+00,   5.02808725e+00,   5.12175544e+00,</tt></dt>
<dt>
<tt class="descname">5.21716858e+00,   5.31435916e+00,   5.41336030e+00,</tt></dt>
<dt>
<tt class="descname">5.51420574e+00,   5.61692982e+00,   5.72156756e+00,</tt></dt>
<dt>
<tt class="descname">5.82815458e+00,   5.93672722e+00,   6.04732245e+00,</tt></dt>
<dt>
<tt class="descname">6.15997796e+00,   6.27473213e+00,   6.39162405e+00,</tt></dt>
<dt>
<tt class="descname">6.51069356e+00,   6.63198120e+00,   6.75552832e+00,</tt></dt>
<dt>
<tt class="descname">6.88137699e+00,   7.00957009e+00,   7.14015130e+00,</tt></dt>
<dt>
<tt class="descname">7.27316511e+00,   7.40865683e+00,   7.54667263e+00,</tt></dt>
<dt>
<tt class="descname">7.68725952e+00,   7.83046540e+00,   7.97633907e+00,</tt></dt>
<dt>
<tt class="descname">8.12493021e+00,   8.27628946e+00,   8.43046837e+00,</tt></dt>
<dt>
<tt class="descname">8.58751948e+00,   8.74749630e+00,   8.91045332e+00,</tt></dt>
<dt>
<tt class="descname">9.07644607e+00,   9.24553110e+00,   9.41776601e+00,</tt></dt>
<dt>
<tt class="descname">9.59320948e+00,   9.77192128e+00,   9.95396231e+00,</tt></dt>
<dt>
<tt class="descname">1.01393946e+01,   1.03282813e+01,   1.05206867e+01,</tt></dt>
<dt>
<tt class="descname">1.07166765e+01,   1.09163173e+01,   1.11196773e+01,</tt></dt>
<dt>
<tt class="descname">1.13268257e+01,   1.15378330e+01,   1.17527712e+01,</tt></dt>
<dt>
<tt class="descname">1.19717134e+01,   1.21947344e+01,   1.24219100e+01,</tt></dt>
<dt>
<tt class="descname">1.26533176e+01,   1.28890361e+01,   1.31291459e+01,</tt></dt>
<dt>
<tt class="descname">1.33737286e+01,   1.36228676e+01,   1.38766479e+01,</tt></dt>
<dt>
<tt class="descname">1.41351558e+01,   1.43984795e+01,   1.46667087e+01,</tt></dt>
<dt>
<tt class="descname">1.49399346e+01,   1.52182505e+01,   1.55017512e+01,</tt></dt>
<dt>
<tt class="descname">1.57905331e+01,   1.60846948e+01,   1.63843365e+01,</tt></dt>
<dt>
<tt class="descname">1.66895601e+01,   1.70004698e+01,   1.73171713e+01,</tt></dt>
<dt>
<tt class="descname">1.76397728e+01,   1.79683839e+01,   1.83031168e+01,</tt></dt>
<dt>
<tt class="descname">1.86440853e+01,   1.89914058e+01,   1.93451965e+01,</tt></dt>
<dt>
<tt class="descname">1.97055780e+01,   2.00726730e+01,   2.04466067e+01,</tt></dt>
<dt>
<tt class="descname">2.08275063e+01,   2.12155017e+01,   2.16107251e+01,</tt></dt>
<dt>
<tt class="descname">2.20133111e+01,   2.24233968e+01,   2.28411221e+01,</tt></dt>
<dt>
<tt class="descname">2.32666291e+01,   2.37000629e+01,   2.41415712e+01,</tt></dt>
<dt>
<tt class="descname">2.45913043e+01,   2.50494154e+01,   2.55160607e+01,</tt></dt>
<dt>
<tt class="descname">2.59913992e+01,   2.64755927e+01,   2.69688063e+01,</tt></dt>
<dt>
<tt class="descname">2.74712079e+01,   2.79829688e+01,   2.85042632e+01,</tt></dt>
<dt>
<tt class="descname">2.90352688e+01,   2.95761666e+01,   3.01271407e+01,</tt></dt>
<dt>
<tt class="descname">3.06883789e+01,   3.12600724e+01,   3.18424160e+01,</tt></dt>
<dt>
<tt class="descname">3.24356081e+01,   3.30398507e+01,   3.36553498e+01,</tt></dt>
<dt>
<tt class="descname">3.42823149e+01,   3.49209598e+01,   3.55715021e+01,</tt></dt>
<dt>
<tt class="descname">3.62341632e+01,   3.69091691e+01,   3.75967497e+01,</tt></dt>
<dt>
<tt class="descname">3.82971391e+01,   3.90105762e+01,   3.97373038e+01,</tt></dt>
<dt>
<tt class="descname">4.04775697e+01,   4.12316259e+01,   4.19997295e+01,</tt></dt>
<dt>
<tt class="descname">4.27821420e+01,   4.35791301e+01,   4.43909653e+01,</tt></dt>
<dt>
<tt class="descname">4.52179242e+01,   4.60602884e+01,   4.69183451e+01,</tt></dt>
<dt>
<tt class="descname">4.77923865e+01,   4.86827104e+01,   4.95896201e+01,</tt></dt>
<dt>
<tt class="descname">5.05134247e+01,   5.14544388e+01,   5.24129830e+01,</tt></dt>
<dt>
<tt class="descname">5.33893840e+01,   5.43839743e+01,   5.53970928e+01,</tt></dt>
<dt>
<tt class="descname">5.64290847e+01,   5.74803016e+01,   5.85511016e+01,</tt></dt>
<dt>
<tt class="descname">5.96418495e+01,   6.07529169e+01,   6.18846824e+01,</tt></dt>
<dt>
<tt class="descname">6.30375315e+01,   6.42118571e+01,   6.54080591e+01,</tt></dt>
<dt>
<tt class="descname">6.66265452e+01,   6.78677305e+01,   6.91320378e+01,</tt></dt>
<dt>
<tt class="descname">7.04198979e+01,   7.17317494e+01,   7.30680395e+01,</tt></dt>
<dt>
<tt class="descname">7.44292233e+01,   7.58157646e+01,   7.72281357e+01,</tt></dt>
<dt>
<tt class="descname">7.86668179e+01,   8.01323013e+01,   8.16250851e+01,</tt></dt>
<dt>
<tt class="descname">8.31456781e+01,   8.46945981e+01,   8.62723729e+01,</tt></dt>
<dt>
<tt class="descname">8.78795401e+01,   8.95166472e+01,   9.11842520e+01,</tt></dt>
<dt>
<tt class="descname">9.28829225e+01,   9.46132376e+01,   9.63757866e+01,</tt></dt>
<dt>
<tt class="descname">9.81711702e+01,   1.00000000e+02]))</tt></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<tt class="descname">m_integrate(fn=&lt;function kroupa at 0x10e2b3050&gt;, bins=array([  1.00000000e-02,   1.01862899e-02,   1.03760502e-02,</tt></dt>
<dt>
<tt class="descname">1.05693455e-02,   1.07662418e-02,   1.09668060e-02,</tt></dt>
<dt>
<tt class="descname">1.11711065e-02,   1.13792129e-02,   1.15911962e-02,</tt></dt>
<dt>
<tt class="descname">1.18071285e-02,   1.20270833e-02,   1.22511358e-02,</tt></dt>
<dt>
<tt class="descname">1.24793621e-02,   1.27118400e-02,   1.29486487e-02,</tt></dt>
<dt>
<tt class="descname">1.31898690e-02,   1.34355829e-02,   1.36858742e-02,</tt></dt>
<dt>
<tt class="descname">1.39408283e-02,   1.42005318e-02,   1.44650734e-02,</tt></dt>
<dt>
<tt class="descname">1.47345431e-02,   1.50090328e-02,   1.52886359e-02,</tt></dt>
<dt>
<tt class="descname">1.55734477e-02,   1.58635653e-02,   1.61590875e-02,</tt></dt>
<dt>
<tt class="descname">1.64601150e-02,   1.67667503e-02,   1.70790980e-02,</tt></dt>
<dt>
<tt class="descname">1.73972643e-02,   1.77213578e-02,   1.80514888e-02,</tt></dt>
<dt>
<tt class="descname">1.83877698e-02,   1.87303154e-02,   1.90792422e-02,</tt></dt>
<dt>
<tt class="descname">1.94346693e-02,   1.97967175e-02,   2.01655104e-02,</tt></dt>
<dt>
<tt class="descname">2.05411735e-02,   2.09238348e-02,   2.13136247e-02,</tt></dt>
<dt>
<tt class="descname">2.17106760e-02,   2.21151240e-02,   2.25271064e-02,</tt></dt>
<dt>
<tt class="descname">2.29467637e-02,   2.33742387e-02,   2.38096772e-02,</tt></dt>
<dt>
<tt class="descname">2.42532274e-02,   2.47050406e-02,   2.51652705e-02,</tt></dt>
<dt>
<tt class="descname">2.56340741e-02,   2.61116110e-02,   2.65980440e-02,</tt></dt>
<dt>
<tt class="descname">2.70935387e-02,   2.75982639e-02,   2.81123917e-02,</tt></dt>
<dt>
<tt class="descname">2.86360972e-02,   2.91695588e-02,   2.97129582e-02,</tt></dt>
<dt>
<tt class="descname">3.02664806e-02,   3.08303146e-02,   3.14046522e-02,</tt></dt>
<dt>
<tt class="descname">3.19896892e-02,   3.25856248e-02,   3.31926620e-02,</tt></dt>
<dt>
<tt class="descname">3.38110078e-02,   3.44408728e-02,   3.50824714e-02,</tt></dt>
<dt>
<tt class="descname">3.57360225e-02,   3.64017485e-02,   3.70798763e-02,</tt></dt>
<dt>
<tt class="descname">3.77706369e-02,   3.84742658e-02,   3.91910025e-02,</tt></dt>
<dt>
<tt class="descname">3.99210913e-02,   4.06647809e-02,   4.14223247e-02,</tt></dt>
<dt>
<tt class="descname">4.21939808e-02,   4.29800121e-02,   4.37806863e-02,</tt></dt>
<dt>
<tt class="descname">4.45962763e-02,   4.54270599e-02,   4.62733201e-02,</tt></dt>
<dt>
<tt class="descname">4.71353453e-02,   4.80134292e-02,   4.89078709e-02,</tt></dt>
<dt>
<tt class="descname">4.98189752e-02,   5.07470524e-02,   5.16924187e-02,</tt></dt>
<dt>
<tt class="descname">5.26553963e-02,   5.36363132e-02,   5.46355035e-02,</tt></dt>
<dt>
<tt class="descname">5.56533078e-02,   5.66900727e-02,   5.77461515e-02,</tt></dt>
<dt>
<tt class="descname">5.88219040e-02,   5.99176967e-02,   6.10339029e-02,</tt></dt>
<dt>
<tt class="descname">6.21709029e-02,   6.33290840e-02,   6.45088409e-02,</tt></dt>
<dt>
<tt class="descname">6.57105755e-02,   6.69346971e-02,   6.81816229e-02,</tt></dt>
<dt>
<tt class="descname">6.94517777e-02,   7.07455942e-02,   7.20635132e-02,</tt></dt>
<dt>
<tt class="descname">7.34059837e-02,   7.47734631e-02,   7.61664172e-02,</tt></dt>
<dt>
<tt class="descname">7.75853206e-02,   7.90306568e-02,   8.05029181e-02,</tt></dt>
<dt>
<tt class="descname">8.20026062e-02,   8.35302320e-02,   8.50863158e-02,</tt></dt>
<dt>
<tt class="descname">8.66713880e-02,   8.82859884e-02,   8.99306672e-02,</tt></dt>
<dt>
<tt class="descname">9.16059848e-02,   9.33125118e-02,   9.50508296e-02,</tt></dt>
<dt>
<tt class="descname">9.68215306e-02,   9.86252179e-02,   1.00462506e-01,</tt></dt>
<dt>
<tt class="descname">1.02334021e-01,   1.04240401e-01,   1.06182294e-01,</tt></dt>
<dt>
<tt class="descname">1.08160363e-01,   1.10175281e-01,   1.12227736e-01,</tt></dt>
<dt>
<tt class="descname">1.14318425e-01,   1.16448062e-01,   1.18617372e-01,</tt></dt>
<dt>
<tt class="descname">1.20827094e-01,   1.23077980e-01,   1.25370799e-01,</tt></dt>
<dt>
<tt class="descname">1.27706330e-01,   1.30085370e-01,   1.32508729e-01,</tt></dt>
<dt>
<tt class="descname">1.34977233e-01,   1.37491723e-01,   1.40053055e-01,</tt></dt>
<dt>
<tt class="descname">1.42662102e-01,   1.45319752e-01,   1.48026913e-01,</tt></dt>
<dt>
<tt class="descname">1.50784505e-01,   1.53593468e-01,   1.56454759e-01,</tt></dt>
<dt>
<tt class="descname">1.59369353e-01,   1.62338243e-01,   1.65362441e-01,</tt></dt>
<dt>
<tt class="descname">1.68442976e-01,   1.71580899e-01,   1.74777277e-01,</tt></dt>
<dt>
<tt class="descname">1.78033202e-01,   1.81349780e-01,   1.84728144e-01,</tt></dt>
<dt>
<tt class="descname">1.88169442e-01,   1.91674849e-01,   1.95245558e-01,</tt></dt>
<dt>
<tt class="descname">1.98882786e-01,   2.02587771e-01,   2.06361777e-01,</tt></dt>
<dt>
<tt class="descname">2.10206088e-01,   2.14122015e-01,   2.18110892e-01,</tt></dt>
<dt>
<tt class="descname">2.22174078e-01,   2.26312957e-01,   2.30528939e-01,</tt></dt>
<dt>
<tt class="descname">2.34823460e-01,   2.39197984e-01,   2.43654001e-01,</tt></dt>
<dt>
<tt class="descname">2.48193029e-01,   2.52816614e-01,   2.57526333e-01,</tt></dt>
<dt>
<tt class="descname">2.62323788e-01,   2.67210616e-01,   2.72188479e-01,</tt></dt>
<dt>
<tt class="descname">2.77259076e-01,   2.82424133e-01,   2.87685409e-01,</tt></dt>
<dt>
<tt class="descname">2.93044698e-01,   2.98503825e-01,   3.04064649e-01,</tt></dt>
<dt>
<tt class="descname">3.09729067e-01,   3.15499006e-01,   3.21376434e-01,</tt></dt>
<dt>
<tt class="descname">3.27363353e-01,   3.33461802e-01,   3.39673858e-01,</tt></dt>
<dt>
<tt class="descname">3.46001639e-01,   3.52447300e-01,   3.59013038e-01,</tt></dt>
<dt>
<tt class="descname">3.65701088e-01,   3.72513730e-01,   3.79453285e-01,</tt></dt>
<dt>
<tt class="descname">3.86522116e-01,   3.93722633e-01,   4.01057288e-01,</tt></dt>
<dt>
<tt class="descname">4.08528580e-01,   4.16139055e-01,   4.23891306e-01,</tt></dt>
<dt>
<tt class="descname">4.31787973e-01,   4.39831747e-01,   4.48025368e-01,</tt></dt>
<dt>
<tt class="descname">4.56371628e-01,   4.64873371e-01,   4.73533492e-01,</tt></dt>
<dt>
<tt class="descname">4.82354943e-01,   4.91340729e-01,   5.00493910e-01,</tt></dt>
<dt>
<tt class="descname">5.09817606e-01,   5.19314994e-01,   5.28989308e-01,</tt></dt>
<dt>
<tt class="descname">5.38843844e-01,   5.48881961e-01,   5.59107078e-01,</tt></dt>
<dt>
<tt class="descname">5.69522678e-01,   5.80132310e-01,   5.90939590e-01,</tt></dt>
<dt>
<tt class="descname">6.01948197e-01,   6.13161884e-01,   6.24584471e-01,</tt></dt>
<dt>
<tt class="descname">6.36219849e-01,   6.48071983e-01,   6.60144909e-01,</tt></dt>
<dt>
<tt class="descname">6.72442742e-01,   6.84969672e-01,   6.97729965e-01,</tt></dt>
<dt>
<tt class="descname">7.10727970e-01,   7.23968114e-01,   7.37454909e-01,</tt></dt>
<dt>
<tt class="descname">7.51192949e-01,   7.65186915e-01,   7.79441575e-01,</tt></dt>
<dt>
<tt class="descname">7.93961785e-01,   8.08752491e-01,   8.23818733e-01,</tt></dt>
<dt>
<tt class="descname">8.39165644e-01,   8.54798453e-01,   8.70722485e-01,</tt></dt>
<dt>
<tt class="descname">8.86943166e-01,   9.03466021e-01,   9.20296681e-01,</tt></dt>
<dt>
<tt class="descname">9.37440879e-01,   9.54904456e-01,   9.72693362e-01,</tt></dt>
<dt>
<tt class="descname">9.90813657e-01,   1.00927151e+00,   1.02807322e+00,</tt></dt>
<dt>
<tt class="descname">1.04722519e+00,   1.06673394e+00,   1.08660611e+00,</tt></dt>
<dt>
<tt class="descname">1.10684849e+00,   1.12746796e+00,   1.14847155e+00,</tt></dt>
<dt>
<tt class="descname">1.16986641e+00,   1.19165984e+00,   1.21385926e+00,</tt></dt>
<dt>
<tt class="descname">1.23647224e+00,   1.25950646e+00,   1.28296980e+00,</tt></dt>
<dt>
<tt class="descname">1.30687023e+00,   1.33121590e+00,   1.35601511e+00,</tt></dt>
<dt>
<tt class="descname">1.38127630e+00,   1.40700809e+00,   1.43321923e+00,</tt></dt>
<dt>
<tt class="descname">1.45991865e+00,   1.48711546e+00,   1.51481892e+00,</tt></dt>
<dt>
<tt class="descname">1.54303847e+00,   1.57178372e+00,   1.60106446e+00,</tt></dt>
<dt>
<tt class="descname">1.63089068e+00,   1.66127252e+00,   1.69222035e+00,</tt></dt>
<dt>
<tt class="descname">1.72374471e+00,   1.75585633e+00,   1.78856616e+00,</tt></dt>
<dt>
<tt class="descname">1.82188534e+00,   1.85582523e+00,   1.89039738e+00,</tt></dt>
<dt>
<tt class="descname">1.92561357e+00,   1.96148581e+00,   1.99802631e+00,</tt></dt>
<dt>
<tt class="descname">2.03524752e+00,   2.07316213e+00,   2.11178304e+00,</tt></dt>
<dt>
<tt class="descname">2.15112343e+00,   2.19119669e+00,   2.23201647e+00,</tt></dt>
<dt>
<tt class="descname">2.27359668e+00,   2.31595149e+00,   2.35909533e+00,</tt></dt>
<dt>
<tt class="descname">2.40304289e+00,   2.44780916e+00,   2.49340937e+00,</tt></dt>
<dt>
<tt class="descname">2.53985907e+00,   2.58717408e+00,   2.63537052e+00,</tt></dt>
<dt>
<tt class="descname">2.68446481e+00,   2.73447368e+00,   2.78541416e+00,</tt></dt>
<dt>
<tt class="descname">2.83730362e+00,   2.89015972e+00,   2.94400048e+00,</tt></dt>
<dt>
<tt class="descname">2.99884423e+00,   3.05470967e+00,   3.11161583e+00,</tt></dt>
<dt>
<tt class="descname">3.16958209e+00,   3.22862820e+00,   3.28877429e+00,</tt></dt>
<dt>
<tt class="descname">3.35004083e+00,   3.41244871e+00,   3.47601918e+00,</tt></dt>
<dt>
<tt class="descname">3.54077391e+00,   3.60673495e+00,   3.67392478e+00,</tt></dt>
<dt>
<tt class="descname">3.74236629e+00,   3.81208280e+00,   3.88309805e+00,</tt></dt>
<dt>
<tt class="descname">3.95543624e+00,   4.02912203e+00,   4.10418050e+00,</tt></dt>
<dt>
<tt class="descname">4.18063724e+00,   4.25851829e+00,   4.33785019e+00,</tt></dt>
<dt>
<tt class="descname">4.41865996e+00,   4.50097513e+00,   4.58482375e+00,</tt></dt>
<dt>
<tt class="descname">4.67023439e+00,   4.75723614e+00,   4.84585864e+00,</tt></dt>
<dt>
<tt class="descname">4.93613210e+00,   5.02808725e+00,   5.12175544e+00,</tt></dt>
<dt>
<tt class="descname">5.21716858e+00,   5.31435916e+00,   5.41336030e+00,</tt></dt>
<dt>
<tt class="descname">5.51420574e+00,   5.61692982e+00,   5.72156756e+00,</tt></dt>
<dt>
<tt class="descname">5.82815458e+00,   5.93672722e+00,   6.04732245e+00,</tt></dt>
<dt>
<tt class="descname">6.15997796e+00,   6.27473213e+00,   6.39162405e+00,</tt></dt>
<dt>
<tt class="descname">6.51069356e+00,   6.63198120e+00,   6.75552832e+00,</tt></dt>
<dt>
<tt class="descname">6.88137699e+00,   7.00957009e+00,   7.14015130e+00,</tt></dt>
<dt>
<tt class="descname">7.27316511e+00,   7.40865683e+00,   7.54667263e+00,</tt></dt>
<dt>
<tt class="descname">7.68725952e+00,   7.83046540e+00,   7.97633907e+00,</tt></dt>
<dt>
<tt class="descname">8.12493021e+00,   8.27628946e+00,   8.43046837e+00,</tt></dt>
<dt>
<tt class="descname">8.58751948e+00,   8.74749630e+00,   8.91045332e+00,</tt></dt>
<dt>
<tt class="descname">9.07644607e+00,   9.24553110e+00,   9.41776601e+00,</tt></dt>
<dt>
<tt class="descname">9.59320948e+00,   9.77192128e+00,   9.95396231e+00,</tt></dt>
<dt>
<tt class="descname">1.01393946e+01,   1.03282813e+01,   1.05206867e+01,</tt></dt>
<dt>
<tt class="descname">1.07166765e+01,   1.09163173e+01,   1.11196773e+01,</tt></dt>
<dt>
<tt class="descname">1.13268257e+01,   1.15378330e+01,   1.17527712e+01,</tt></dt>
<dt>
<tt class="descname">1.19717134e+01,   1.21947344e+01,   1.24219100e+01,</tt></dt>
<dt>
<tt class="descname">1.26533176e+01,   1.28890361e+01,   1.31291459e+01,</tt></dt>
<dt>
<tt class="descname">1.33737286e+01,   1.36228676e+01,   1.38766479e+01,</tt></dt>
<dt>
<tt class="descname">1.41351558e+01,   1.43984795e+01,   1.46667087e+01,</tt></dt>
<dt>
<tt class="descname">1.49399346e+01,   1.52182505e+01,   1.55017512e+01,</tt></dt>
<dt>
<tt class="descname">1.57905331e+01,   1.60846948e+01,   1.63843365e+01,</tt></dt>
<dt>
<tt class="descname">1.66895601e+01,   1.70004698e+01,   1.73171713e+01,</tt></dt>
<dt>
<tt class="descname">1.76397728e+01,   1.79683839e+01,   1.83031168e+01,</tt></dt>
<dt>
<tt class="descname">1.86440853e+01,   1.89914058e+01,   1.93451965e+01,</tt></dt>
<dt>
<tt class="descname">1.97055780e+01,   2.00726730e+01,   2.04466067e+01,</tt></dt>
<dt>
<tt class="descname">2.08275063e+01,   2.12155017e+01,   2.16107251e+01,</tt></dt>
<dt>
<tt class="descname">2.20133111e+01,   2.24233968e+01,   2.28411221e+01,</tt></dt>
<dt>
<tt class="descname">2.32666291e+01,   2.37000629e+01,   2.41415712e+01,</tt></dt>
<dt>
<tt class="descname">2.45913043e+01,   2.50494154e+01,   2.55160607e+01,</tt></dt>
<dt>
<tt class="descname">2.59913992e+01,   2.64755927e+01,   2.69688063e+01,</tt></dt>
<dt>
<tt class="descname">2.74712079e+01,   2.79829688e+01,   2.85042632e+01,</tt></dt>
<dt>
<tt class="descname">2.90352688e+01,   2.95761666e+01,   3.01271407e+01,</tt></dt>
<dt>
<tt class="descname">3.06883789e+01,   3.12600724e+01,   3.18424160e+01,</tt></dt>
<dt>
<tt class="descname">3.24356081e+01,   3.30398507e+01,   3.36553498e+01,</tt></dt>
<dt>
<tt class="descname">3.42823149e+01,   3.49209598e+01,   3.55715021e+01,</tt></dt>
<dt>
<tt class="descname">3.62341632e+01,   3.69091691e+01,   3.75967497e+01,</tt></dt>
<dt>
<tt class="descname">3.82971391e+01,   3.90105762e+01,   3.97373038e+01,</tt></dt>
<dt>
<tt class="descname">4.04775697e+01,   4.12316259e+01,   4.19997295e+01,</tt></dt>
<dt>
<tt class="descname">4.27821420e+01,   4.35791301e+01,   4.43909653e+01,</tt></dt>
<dt>
<tt class="descname">4.52179242e+01,   4.60602884e+01,   4.69183451e+01,</tt></dt>
<dt>
<tt class="descname">4.77923865e+01,   4.86827104e+01,   4.95896201e+01,</tt></dt>
<dt>
<tt class="descname">5.05134247e+01,   5.14544388e+01,   5.24129830e+01,</tt></dt>
<dt>
<tt class="descname">5.33893840e+01,   5.43839743e+01,   5.53970928e+01,</tt></dt>
<dt>
<tt class="descname">5.64290847e+01,   5.74803016e+01,   5.85511016e+01,</tt></dt>
<dt>
<tt class="descname">5.96418495e+01,   6.07529169e+01,   6.18846824e+01,</tt></dt>
<dt>
<tt class="descname">6.30375315e+01,   6.42118571e+01,   6.54080591e+01,</tt></dt>
<dt>
<tt class="descname">6.66265452e+01,   6.78677305e+01,   6.91320378e+01,</tt></dt>
<dt>
<tt class="descname">7.04198979e+01,   7.17317494e+01,   7.30680395e+01,</tt></dt>
<dt>
<tt class="descname">7.44292233e+01,   7.58157646e+01,   7.72281357e+01,</tt></dt>
<dt>
<tt class="descname">7.86668179e+01,   8.01323013e+01,   8.16250851e+01,</tt></dt>
<dt>
<tt class="descname">8.31456781e+01,   8.46945981e+01,   8.62723729e+01,</tt></dt>
<dt>
<tt class="descname">8.78795401e+01,   8.95166472e+01,   9.11842520e+01,</tt></dt>
<dt>
<tt class="descname">9.28829225e+01,   9.46132376e+01,   9.63757866e+01,</tt></dt>
<dt>
<tt class="descname">9.81711702e+01,   1.00000000e+02]))</tt></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.imf.make_cluster">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">make_cluster</tt><big>(</big><em>mcluster</em>, <em>massfunc='kroupa'</em>, <em>verbose=False</em>, <em>silent=False</em>, <em>tolerance=0.5</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#make_cluster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.make_cluster" title="Permalink to this definition">¶</a></dt>
<dd><p>Sample from an IMF to make a cluster.  Returns the masses of all stars in the cluster</p>
<p>massfunc must be a string 
tolerance is how close the cluster mass must be to the requested mass.  
If the last star is greater than this tolerance, the total mass will not be within
tolerance of the requested</p>
<p>kwargs are passed to <a class="reference internal" href="#agpy.imf.inverse_imf" title="agpy.imf.inverse_imf"><tt class="xref py py-obj docutils literal"><span class="pre">inverse_imf</span></tt></a></p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.salpeter">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">salpeter</tt><big>(</big><em>m</em>, <em>alpha=2.3500000000000001</em>, <em>integral=False</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#salpeter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.salpeter" title="Permalink to this definition">¶</a></dt>
<dd><p>the Salpeter 1955 IMF: dn/dm ~ m^-2.35</p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.schechter">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">schechter</tt><big>(</big><em>m</em>, <em>A=1</em>, <em>beta=2</em>, <em>m0=100</em>, <em>integral=False</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#schechter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.schechter" title="Permalink to this definition">¶</a></dt>
<dd><p>A Schechter function with arbitrary defaults
(integral may not be correct - exponent hasn&#8217;t been dealt with at all)</p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.schechter_cdf">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">schechter_cdf</tt><big>(</big><em>m</em>, <em>A=1</em>, <em>beta=2</em>, <em>m0=100</em>, <em>mmin=10</em>, <em>mmax=None</em>, <em>npts=10000.0</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#schechter_cdf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.schechter_cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the CDF value of a given mass for a set mmin,mmax
mmax will default to 10 m0 if not specified</p>
<p>Analytic integral of the Schechter function:
<a class="reference external" href="http://www.wolframalpha.com/input/">http://www.wolframalpha.com/input/</a>?i=integral%28x^-a+exp%28-x%2Fm%29+dx%29</p>
</dd></dl>

<dl class="function">
<dt id="agpy.imf.sh_cdf_func">
<tt class="descclassname">agpy.imf.</tt><tt class="descname">sh_cdf_func</tt><big>(</big><em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/imf.html#sh_cdf_func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.imf.sh_cdf_func" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.kdist">
<span id="kdist-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">kdist</span></tt> Module<a class="headerlink" href="#module-agpy.kdist" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.kdist.kdist">
<tt class="descclassname">agpy.kdist.</tt><tt class="descname">kdist</tt><big>(</big><em>l</em>, <em>b</em>, <em>vin</em>, <em>near=True</em>, <em>r0=8400.0</em>, <em>v0=254.0</em>, <em>dynamical=False</em>, <em>kinematic=True</em>, <em>regular=False</em>, <em>rrgal=False</em>, <em>verbose=False</em>, <em>inverse=False</em>, <em>silent=False</em>, <em>returnvtan=False</em><big>)</big><a class="reference internal" href="_modules/agpy/kdist.html#kdist"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.kdist.kdist" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>NAME:</dt>
<dd>KINDIST</dd>
<dt>PURPOSE:</dt>
<dd>To return the distance to an object given l,b,v</dd>
<dt>CALLING SEQUENCE:</dt>
<dd>dist = KDIST (L, B, V)</dd>
<dt>INPUTS:</dt>
<dd>L, B &#8211; Galactic Longitude and Latitude (decimal degrees)
V - Velocity w.r.t. LSR in km/s</dd>
<dt>KEYWORD PARAMETERS:</dt>
<dd><dl class="first docutils">
<dt>/NEAR, /FAR &#8211; Report the near/far kinematic distances for Q1 and</dt>
<dd>Q4 data.</dd>
<dt>RO, VO &#8211; Force values for galactocentric distance for sun and</dt>
<dd>velocity of the LSR around the GC.  Default to 8.4 kpc
and 254 km/s (Reid et al., 2009)</dd>
</dl>
<p>RGAL &#8211; Named keyword containing galactocentric radius of sources.
rrgal  - return galactocentric distance in addition to distance from us
/DYNAMICAL &#8211; Use the dynamical definition of the LSR
/KINEMATIC &#8211; Use the kinematic definition of the LSR (default)
/REGULAR &#8211; Do not apply the rotation correction for High mass</p>
<blockquote class="last">
<div><blockquote>
<div>star forming regions.</div></blockquote>
<dl class="docutils">
<dt>INVERSE &#8211; If set, pass DISTANCE instead of velocity, and output is</dt>
<dd>velocity</dd>
<dt>returnvtan - if set, return the tanent velocity and ignore the input</dt>
<dd>velocity</dd>
</dl>
</div></blockquote>
</dd>
<dt>OUTPUTS:</dt>
<dd>DIST &#8211; the kinematic distance in units of R0 (defaults to pc).</dd>
</dl>
<p>MODIFICATION HISTORY:</p>
<blockquote>
<div><dl class="docutils">
<dt>Fri Feb 27 00:47:18 2009, Erik &lt;<a class="reference external" href="mailto:eros&#37;&#52;&#48;orthanc&#46;local">eros<span>&#64;</span>orthanc<span>&#46;</span>local</a>&gt;</dt>
<dd>Adapted from kindist.pro
Translated from IDL to Python by Adam Ginsburg (<a class="reference external" href="mailto:adam&#46;ginsburg&#37;&#52;&#48;colorado&#46;edu">adam<span>&#46;</span>ginsburg<span>&#64;</span>colorado<span>&#46;</span>edu</a>)</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="agpy.kdist.threekpcarm">
<tt class="descclassname">agpy.kdist.</tt><tt class="descname">threekpcarm</tt><big>(</big><em>longitude</em>, <em>radius=3.0</em>, <em>center_distance=8.5</em><big>)</big><a class="reference internal" href="_modules/agpy/kdist.html#threekpcarm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.kdist.threekpcarm" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.kdist.vector_kdist">
<tt class="descclassname">agpy.kdist.</tt><tt class="descname">vector_kdist</tt><big>(</big><em>x</em>, <em>y</em>, <em>z</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/kdist.html#vector_kdist"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.kdist.vector_kdist" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.lagrange_diff">
<span id="lagrange-diff-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">lagrange_diff</span></tt> Module<a class="headerlink" href="#module-agpy.lagrange_diff" title="Permalink to this headline">¶</a></h2>
<p>Implementation of the Lagrange differentiation scheme employed by Molinari et
al 2010 and Molinari et al 2011 to identify filamentary structures.</p>
<p>How do you compute the lagrange derivative coefficients analytically?  This procedure
is orders of magnitude too slow</p>
<dl class="function">
<dt id="agpy.lagrange_diff.laplace_interp">
<tt class="descclassname">agpy.lagrange_diff.</tt><tt class="descname">laplace_interp</tt><big>(</big><em>image</em>, <em>splineimage=None</em>, <em>direction='vertical'</em>, <em>splinesmooth=1.0</em><big>)</big><a class="reference internal" href="_modules/agpy/lagrange_diff.html#laplace_interp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.lagrange_diff.laplace_interp" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.lagrange_diff.max_curvature">
<tt class="descclassname">agpy.lagrange_diff.</tt><tt class="descname">max_curvature</tt><big>(</big><em>image</em>, <em>splinesmooth=2.0</em><big>)</big><a class="reference internal" href="_modules/agpy/lagrange_diff.html#max_curvature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.lagrange_diff.max_curvature" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.luminosity">
<span id="luminosity-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">luminosity</span></tt> Module<a class="headerlink" href="#module-agpy.luminosity" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="agpy.luminosity.luminosity">
<em class="property">class </em><tt class="descclassname">agpy.luminosity.</tt><tt class="descname">luminosity</tt><big>(</big><em>nu</em>, <em>fnu</em>, <em>wnu=None</em>, <em>lnu=None</em>, <em>unu=None</em>, <em>efnu=None</em>, <em>dist_pc=None</em>, <em>npoints=100000.0</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity" title="Permalink to this definition">¶</a></dt>
<dd><p>Measures luminosity from an SED following the method of Kauffmann et al 2008
<a class="reference external" href="http://adsabs.harvard.edu/abs/2008A%26A...487..993K">http://adsabs.harvard.edu/abs/2008A%26A...487..993K</a></p>
<p>For frequency, bandwidth, etc. see <a class="reference external" href="http://casa.colorado.edu/~ginsbura/filtersets.htm">http://casa.colorado.edu/~ginsbura/filtersets.htm</a></p>
<p>Units are CGS</p>
<p>nu - frequency (assumed Hz)
wnu - [optional/required for non-interpolation] width of frequency bin
lnu/unu - lower/upper bounds on frequency bin
fnu - flux (assumed Jy)
efnu - [optional; currently does nothing] flux error</p>
<p>When interpolation is used, data is added to the luminosity&#8217; classes nu/fnu vectors.
If you use, e.g. luminosity.lbol_meas(), it will still work correctly because it sets
wnu ~ unu-lnu = 0</p>
<dl class="method">
<dt id="agpy.luminosity.luminosity.fbol_interp">
<tt class="descname">fbol_interp</tt><big>(</big><em>fnu=None</em>, <em>mminterp=True</em>, <em>npoints=100000.0</em>, <em>addpoint=True</em>, <em>mmfreq=None</em>, <em>extrap=True</em>, <em>write=True</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.fbol_interp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.fbol_interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolates between data points to integrate over SED</p>
<p>If mminterp is set, will assume a nu^4 power law (opacity lambda^-2)
from the longest wavelength point</p>
<p>Returns int( nuFnu ) in units HzJy</p>
<p>Extrapolate via a constant line at the low/high frequency data point</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.fbol_meas">
<tt class="descname">fbol_meas</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.fbol_meas"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.fbol_meas" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the total integrated flux (int[nu fnu dnu]) measured within 
the bands.  Does not interpolate</p>
<p>The Casoli et al 1986 formula is not used...
FIR (10^-13 W m^-2) = 1.75 ( F12 / 0.79 + F25/2 + F60/3.9 + F100/9.9 )</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.init_interp">
<tt class="descname">init_interp</tt><big>(</big><em>npoints</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.init_interp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.init_interp" title="Permalink to this definition">¶</a></dt>
<dd><p>initializes the interpolation parameters</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.lbol_interp">
<tt class="descname">lbol_interp</tt><big>(</big><em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.lbol_interp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.lbol_interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Bolometric luminosity from interpolation in units of solar luminosities</p>
<p>By default, adds a point at 500 microns extrapolated using a nu^4 power law 
(opacity nu^2) from the longest wavelength data point.  Specify addpoint=False
to disable this feature.</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.lbol_interp_llim">
<tt class="descname">lbol_interp_llim</tt><big>(</big><em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.lbol_interp_llim"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.lbol_interp_llim" title="Permalink to this definition">¶</a></dt>
<dd><p>If errors are specified, returns lbol(fnu+efnu)</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.lbol_interp_ulim">
<tt class="descname">lbol_interp_ulim</tt><big>(</big><em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.lbol_interp_ulim"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.lbol_interp_ulim" title="Permalink to this definition">¶</a></dt>
<dd><p>If errors are specified, returns lbol(fnu+efnu)</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.lbol_meas">
<tt class="descname">lbol_meas</tt><big>(</big><em>dist_pc=None</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.lbol_meas"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.lbol_meas" title="Permalink to this definition">¶</a></dt>
<dd><p>Returned the luminosity within the measured bins.  Does not interpolate.
A distance must be specified either here or in the initialization</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.mminterp">
<tt class="descname">mminterp</tt><big>(</big><em>freq</em>, <em>lowfreq=599584916000.0</em>, <em>alpha=4.0</em>, <em>addpoint=True</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.mminterp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.mminterp" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates an interpolated point using an assumed nu^alpha opacity...
defaults to alpha=4 (beta=2)</p>
<p>Default point location is 500 microns</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.plotsed">
<tt class="descname">plotsed</tt><big>(</big><em>loglog=True</em>, <em>nufnu=False</em>, <em>interpplot=False</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.plotsed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.plotsed" title="Permalink to this definition">¶</a></dt>
<dd><p>Plots the SED</p>
</dd></dl>

<dl class="method">
<dt id="agpy.luminosity.luminosity.tbol">
<tt class="descname">tbol</tt><big>(</big><em>interp=True</em><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#luminosity.tbol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.luminosity.tbol" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the &#8220;bolometric temperature&#8221; as specified in the same document.
Uses scipy&#8217;s zeta function if scipy is available</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="agpy.luminosity.test_case">
<tt class="descclassname">agpy.luminosity.</tt><tt class="descname">test_case</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/agpy/luminosity.html#test_case"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.luminosity.test_case" title="Permalink to this definition">¶</a></dt>
<dd><p>A specific test case using the Klein 2005 luminosity computations</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.mad">
<span id="mad-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">mad</span></tt> Module<a class="headerlink" href="#module-agpy.mad" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.mad.MAD">
<tt class="descclassname">agpy.mad.</tt><tt class="descname">MAD</tt><big>(</big><em>a</em>, <em>c=0.67449999999999999</em>, <em>axis=None</em><big>)</big><a class="reference internal" href="_modules/agpy/mad.html#MAD"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mad.MAD" title="Permalink to this definition">¶</a></dt>
<dd><p>Median Absolute Deviation along given axis of an array:</p>
<p>median(abs(a - median(a))) / c</p>
<p>c = 0.6745 is the constant to convert from MAD to std; it is used by
default</p>
</dd></dl>

<dl class="function">
<dt id="agpy.mad.nanmedian">
<tt class="descclassname">agpy.mad.</tt><tt class="descname">nanmedian</tt><big>(</big><em>arr</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/mad.html#nanmedian"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mad.nanmedian" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns median ignoring NAN</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.mpfit_custom">
<span id="mpfit-custom-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">mpfit_custom</span></tt> Module<a class="headerlink" href="#module-agpy.mpfit_custom" title="Permalink to this headline">¶</a></h2>
<p>Perform Levenberg-Marquardt least-squares minimization, based on MINPACK-1.</p>
<blockquote>
<div><blockquote>
<div><blockquote>
<div>AUTHORS</div></blockquote>
<p>The original version of this software, called LMFIT, was written in FORTRAN
as part of the MINPACK-1 package by XXX.</p>
<p>Craig Markwardt converted the FORTRAN code to IDL.  The information for the
IDL version is:</p>
<blockquote>
<div><p>Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
<a class="reference external" href="mailto:craigm&#37;&#52;&#48;lheamail&#46;gsfc&#46;nasa&#46;gov">craigm<span>&#64;</span>lheamail<span>&#46;</span>gsfc<span>&#46;</span>nasa<span>&#46;</span>gov</a>
UPDATED VERSIONs can be found on my WEB PAGE:</p>
<blockquote>
<div><a class="reference external" href="http://cow.physics.wisc.edu/~craigm/idl/idl.html">http://cow.physics.wisc.edu/~craigm/idl/idl.html</a></div></blockquote>
</div></blockquote>
<dl class="docutils">
<dt>Mark Rivers created this Python version from Craig&#8217;s IDL version.</dt>
<dd>Mark Rivers, University of Chicago
Building 434A, Argonne National Laboratory
9700 South Cass Avenue, Argonne, IL 60439
<a class="reference external" href="mailto:rivers&#37;&#52;&#48;cars&#46;uchicago&#46;edu">rivers<span>&#64;</span>cars<span>&#46;</span>uchicago<span>&#46;</span>edu</a>
Updated versions can be found at <a class="reference external" href="http://cars.uchicago.edu/software">http://cars.uchicago.edu/software</a></dd>
</dl>
</div></blockquote>
<dl class="docutils">
<dt>Sergey Koposov converted the Mark&#8217;s Python version from Numeric to numpy</dt>
<dd><p class="first">Sergey Koposov, Max Planck Institute for Astronomy
Heidelberg, Germany, D-69117
<a class="reference external" href="mailto:koposov&#37;&#52;&#48;mpia&#46;de">koposov<span>&#64;</span>mpia<span>&#46;</span>de</a>
Updated versions can be found at <a class="reference external" href="http://code.google.com/p/astrolibpy/source/browse/trunk/">http://code.google.com/p/astrolibpy/source/browse/trunk/</a></p>
<blockquote class="last">
<div>DESCRIPTION</div></blockquote>
</dd>
</dl>
<p>MPFIT uses the Levenberg-Marquardt technique to solve the
least-squares problem.  In its typical use, MPFIT will be used to
fit a user-supplied function (the &#8220;model&#8221;) to user-supplied data
points (the &#8220;data&#8221;) by adjusting a set of parameters.  MPFIT is
based upon MINPACK-1 (LMDIF.F) by More&#8217; and collaborators.</p>
<p>For example, a researcher may think that a set of observed data
points is best modelled with a Gaussian curve.  A Gaussian curve is
parameterized by its mean, standard deviation and normalization.
MPFIT will, within certain constraints, find the set of parameters
which best fits the data.  The fit is &#8220;best&#8221; in the least-squares
sense; that is, the sum of the weighted squared differences between
the model and data is minimized.</p>
<p>The Levenberg-Marquardt technique is a particular strategy for
iteratively searching for the best fit.  This particular
implementation is drawn from MINPACK-1 (see NETLIB), and is much faster
and more accurate than the version provided in the Scientific Python package
in Scientific.Functions.LeastSquares.
This version allows upper and lower bounding constraints to be placed on each
parameter, or the parameter can be held fixed.</p>
<p>The user-supplied Python function should return an array of weighted
deviations between model and data.  In a typical scientific problem
the residuals should be weighted so that each deviate has a
gaussian sigma of 1.0.  If X represents values of the independent
variable, Y represents a measurement for each value of X, and ERR
represents the error in the measurements, then the deviates could
be calculated as follows:</p>
<blockquote>
<div>DEVIATES = (Y - F(X)) / ERR</div></blockquote>
<p>where F is the analytical function representing the model.  You are
recommended to use the convenience functions MPFITFUN and
MPFITEXPR, which are driver functions that calculate the deviates
for you.  If ERR are the 1-sigma uncertainties in Y, then</p>
<blockquote>
<div>TOTAL( DEVIATES^2 )</div></blockquote>
<p>will be the total chi-squared value.  MPFIT will minimize the
chi-square value.  The values of X, Y and ERR are passed through
MPFIT to the user-supplied function via the FUNCTKW keyword.</p>
<p>Simple constraints can be placed on parameter values by using the
PARINFO keyword to MPFIT.  See below for a description of this
keyword.</p>
<p>MPFIT does not perform more general optimization tasks.  See TNMIN
instead.  MPFIT is customized, based on MINPACK-1, to the
least-squares minimization problem.</p>
<blockquote>
<div>USER FUNCTION</div></blockquote>
<p>The user must define a function which returns the appropriate
values as specified above.  The function should return the weighted
deviations between the model and the data.  It should also return a status
flag and an optional partial derivative array.  For applications which
use finite-difference derivatives &#8211; the default &#8211; the user
function should be declared in the following way:</p>
<blockquote>
<div><dl class="docutils">
<dt>def myfunct(p, fjac=None, x=None, y=None, err=None)</dt>
<dd># Parameter values are passed in &#8220;p&#8221;
# If fjac==None then partial derivatives should not be
# computed.  It will always be None if MPFIT is called with default
# flag.
model = F(x, p)
# Non-negative status value means MPFIT should continue, negative means
# stop the calculation.
status = 0
return([status, (y-model)/err]</dd>
</dl>
</div></blockquote>
<p>See below for applications with analytical derivatives.</p>
<p>The keyword parameters X, Y, and ERR in the example above are
suggestive but not required.  Any parameters can be passed to
MYFUNCT by using the functkw keyword to MPFIT.  Use MPFITFUN and
MPFITEXPR if you need ideas on how to do that.  The function <em>must</em>
accept a parameter list, P.</p>
<p>In general there are no restrictions on the number of dimensions in
X, Y or ERR.  However the deviates <em>must</em> be returned in a
one-dimensional Numeric array of type Float.</p>
<p>User functions may also indicate a fatal error condition using the
status return described above. If status is set to a number between
-15 and -1 then MPFIT will stop the calculation and return to the caller.</p>
<blockquote>
<div>ANALYTIC DERIVATIVES</div></blockquote>
<p>In the search for the best-fit solution, MPFIT by default
calculates derivatives numerically via a finite difference
approximation.  The user-supplied function need not calculate the
derivatives explicitly.  However, if you desire to compute them
analytically, then the AUTODERIVATIVE=0 keyword must be passed to MPFIT.
As a practical matter, it is often sufficient and even faster to allow
MPFIT to calculate the derivatives numerically, and so
AUTODERIVATIVE=0 is not necessary.</p>
<p>If AUTODERIVATIVE=0 is used then the user function must check the parameter
FJAC, and if FJAC!=None then return the partial derivative array in the
return list.</p>
<blockquote>
<div><dl class="docutils">
<dt>def myfunct(p, fjac=None, x=None, y=None, err=None)</dt>
<dd><p class="first"># Parameter values are passed in &#8220;p&#8221;
# If FJAC!=None then partial derivatives must be comptuer.
# FJAC contains an array of len(p), where each entry
# is 1 if that parameter is free and 0 if it is fixed.
model = F(x, p)
Non-negative status value means MPFIT should continue, negative means
# stop the calculation.
status = 0
if (dojac):</p>
<blockquote>
<div><p>pderiv = zeros([len(x), len(p)], Float)
for j in range(len(p)):</p>
<blockquote>
<div>pderiv[:,j] = FGRAD(x, p, j)</div></blockquote>
</div></blockquote>
<dl class="docutils">
<dt>else:</dt>
<dd>pderiv = None</dd>
</dl>
<p class="last">return([status, (y-model)/err, pderiv]</p>
</dd>
</dl>
</div></blockquote>
<p>where FGRAD(x, p, i) is a user function which must compute the
derivative of the model with respect to parameter P[i] at X.  When
finite differencing is used for computing derivatives (ie, when
AUTODERIVATIVE=1), or when MPFIT needs only the errors but not the
derivatives the parameter FJAC=None.</p>
<p>Derivatives should be returned in the PDERIV array. PDERIV should be an m x
n array, where m is the number of data points and n is the number
of parameters.  dp[i,j] is the derivative at the ith point with
respect to the jth parameter.</p>
<p>The derivatives with respect to fixed parameters are ignored; zero
is an appropriate value to insert for those derivatives.  Upon
input to the user function, FJAC is set to a vector with the same
length as P, with a value of 1 for a parameter which is free, and a
value of zero for a parameter which is fixed (and hence no
derivative needs to be calculated).</p>
<p>If the data is higher than one dimensional, then the <em>last</em>
dimension should be the parameter dimension.  Example: fitting a
50x50 image, &#8220;dp&#8221; should be 50x50xNPAR.</p>
<blockquote>
<div>CONSTRAINING PARAMETER VALUES WITH THE PARINFO KEYWORD</div></blockquote>
<p>The behavior of MPFIT can be modified with respect to each
parameter to be fitted.  A parameter value can be fixed; simple
boundary constraints can be imposed; limitations on the parameter
changes can be imposed; properties of the automatic derivative can
be modified; and parameters can be tied to one another.</p>
<p>These properties are governed by the PARINFO structure, which is
passed as a keyword parameter to MPFIT.</p>
<p>PARINFO should be a list of dictionaries, one list entry for each parameter.
Each parameter is associated with one element of the array, in
numerical order.  The dictionary can have the following keys
(none are required, keys are case insensitive):</p>
<blockquote>
<div><dl class="docutils">
<dt>&#8216;value&#8217; - the starting parameter value (but see the START_PARAMS</dt>
<dd>parameter for more information).</dd>
<dt>&#8216;fixed&#8217; - a boolean value, whether the parameter is to be held</dt>
<dd>fixed or not.  Fixed parameters are not varied by
MPFIT, but are passed on to MYFUNCT for evaluation.</dd>
<dt>&#8216;limited&#8217; - a two-element boolean array.  If the first/second</dt>
<dd>element is set, then the parameter is bounded on the
lower/upper side.  A parameter can be bounded on both
sides.  Both LIMITED and LIMITS must be given
together.</dd>
<dt>&#8216;limits&#8217; - a two-element float array.  Gives the</dt>
<dd>parameter limits on the lower and upper sides,
respectively.  Zero, one or two of these values can be
set, depending on the values of LIMITED.  Both LIMITED
and LIMITS must be given together.</dd>
<dt>&#8216;parname&#8217; - a string, giving the name of the parameter.  The</dt>
<dd>fitting code of MPFIT does not use this tag in any
way.  However, the default iterfunct will print the
parameter name if available.</dd>
<dt>&#8216;step&#8217; - the step size to be used in calculating the numerical</dt>
<dd>derivatives.  If set to zero, then the step size is
computed automatically.  Ignored when AUTODERIVATIVE=0.</dd>
<dt>&#8216;mpside&#8217; - the sidedness of the finite difference when computing</dt>
<dd><blockquote class="first">
<div><p>numerical derivatives.  This field can take four
values:</p>
<blockquote>
<div><blockquote>
<div>0 - one-sided derivative computed automatically
1 - one-sided derivative (f(x+h) - f(x)  )/h</div></blockquote>
<dl class="docutils">
<dt>-1 - one-sided derivative (f(x)   - f(x-h))/h</dt>
<dd>2 - two-sided derivative (f(x+h) - f(x-h))/(2*h)</dd>
</dl>
</div></blockquote>
</div></blockquote>
<p class="last">Where H is the STEP parameter described above.  The
&#8220;automatic&#8221; one-sided derivative method will chose a
direction for the finite difference which does not
violate any constraints.  The other methods do not
perform this check.  The two-sided method is in
principle more precise, but requires twice as many
function evaluations.  Default: 0.</p>
</dd>
<dt>&#8216;mpmaxstep&#8217; - the maximum change to be made in the parameter</dt>
<dd><p class="first">value.  During the fitting process, the parameter
will never be changed by more than this value in
one iteration.</p>
<p class="last">A value of 0 indicates no maximum.  Default: 0.</p>
</dd>
<dt>&#8216;tied&#8217; - a string expression which &#8220;ties&#8221; the parameter to other</dt>
<dd>free or fixed parameters.  Any expression involving
constants and the parameter array P are permitted.
Example: if parameter 2 is always to be twice parameter
1 then use the following: parinfo(2).tied = &#8216;2 * p(1)&#8217;.
Since they are totally constrained, tied parameters are
considered to be fixed; no errors are computed for them.
[ NOTE: the PARNAME can&#8217;t be used in expressions. ]</dd>
<dt>&#8216;mpprint&#8217; - if set to 1, then the default iterfunct will print the</dt>
<dd>parameter value.  If set to 0, the parameter value
will not be printed.  This tag can be used to
selectively print only a few parameter values out of
many.  Default: 1 (all parameters printed)</dd>
</dl>
</div></blockquote>
<p>Future modifications to the PARINFO structure, if any, will involve
adding dictionary tags beginning with the two letters &#8220;MP&#8221;.
Therefore programmers are urged to avoid using tags starting with
the same letters; otherwise they are free to include their own
fields within the PARINFO structure, and they will be ignored.</p>
<p>PARINFO Example:
parinfo = [{&#8216;value&#8217;:0., &#8216;fixed&#8217;:0, &#8216;limited&#8217;:[0,0], &#8216;limits&#8217;:[0.,0.]}</p>
<blockquote>
<div>for i in range(5)]</div></blockquote>
<p>parinfo[0][&#8216;fixed&#8217;] = 1
parinfo[4][&#8216;limited&#8217;][0] = 1
parinfo[4][&#8216;limits&#8217;][0]  = 50.
values = [5.7, 2.2, 500., 1.5, 2000.]
for i in range(5): parinfo[i][&#8216;value&#8217;]=values[i]</p>
<p>A total of 5 parameters, with starting values of 5.7,
2.2, 500, 1.5, and 2000 are given.  The first parameter
is fixed at a value of 5.7, and the last parameter is
constrained to be above 50.</p>
<blockquote>
<div><blockquote>
<div>EXAMPLE</div></blockquote>
<p>import mpfit
import numpy.oldnumeric as Numeric
x = arange(100, float)
p0 = [5.7, 2.2, 500., 1.5, 2000.]
y = ( p[0] + p[1]*[x] + p[2]*[x**2] + p[3]*sqrt(x) +</p>
<blockquote>
<div>p[4]*log(x))</div></blockquote>
<p>fa = {&#8216;x&#8217;:x, &#8216;y&#8217;:y, &#8216;err&#8217;:err}
m = mpfit(&#8216;myfunct&#8217;, p0, functkw=fa)
print &#8216;status = &#8216;, m.status
if (m.status &lt;= 0): print &#8216;error message = &#8216;, m.errmsg
print &#8216;parameters = &#8216;, m.params</p>
<p>Minimizes sum of squares of MYFUNCT.  MYFUNCT is called with the X,
Y, and ERR keyword parameters that are given by FUNCTKW.  The
results can be obtained from the returned object m.</p>
<blockquote>
<div>THEORY OF OPERATION</div></blockquote>
<p>There are many specific strategies for function minimization.  One
very popular technique is to use function gradient information to
realize the local structure of the function.  Near a local minimum
the function value can be taylor expanded about x0 as follows:</p>
<blockquote>
<div><blockquote>
<div><dl class="docutils">
<dt>f(x) = f(x0) + f&#8217;(x0) . (x-x0) + (1/2) (x-x0) . f&#8217;&#8216;(x0) . (x-x0)</dt>
<dd>&#8212;&#8211;   &#8212;&#8212;&#8212;&#8212;&#8212;   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-  (1)</dd>
</dl>
</div></blockquote>
<p>Order  0th       1st                     2nd</p>
</div></blockquote>
<p>Here f&#8217;(x) is the gradient vector of f at x, and f&#8217;&#8216;(x) is the
Hessian matrix of second derivatives of f at x.  The vector x is
the set of function parameters, not the measured data vector.  One
can find the minimum of f, f(xm) using Newton&#8217;s method, and
arrives at the following linear equation:</p>
<blockquote>
<div>f&#8217;&#8216;(x0) . (xm-x0) = - f&#8217;(x0)                          (2)</div></blockquote>
<p>If an inverse can be found for f&#8217;&#8216;(x0) then one can solve for
(xm-x0), the step vector from the current position x0 to the new
projected minimum.  Here the problem has been linearized (ie, the
gradient information is known to first order).  f&#8217;&#8216;(x0) is
symmetric n x n matrix, and should be positive definite.</p>
<p>The Levenberg - Marquardt technique is a variation on this theme.
It adds an additional diagonal term to the equation which may aid the
convergence properties:</p>
<blockquote>
<div>(f&#8217;&#8216;(x0) + nu I) . (xm-x0) = -f&#8217;(x0)                (2a)</div></blockquote>
<p>where I is the identity matrix.  When nu is large, the overall
matrix is diagonally dominant, and the iterations follow steepest
descent.  When nu is small, the iterations are quadratically
convergent.</p>
<p>In principle, if f&#8217;&#8216;(x0) and f&#8217;(x0) are known then xm-x0 can be
determined.  However the Hessian matrix is often difficult or
impossible to compute.  The gradient f&#8217;(x0) may be easier to
compute, if even by finite difference techniques.  So-called
quasi-Newton techniques attempt to successively estimate f&#8217;&#8216;(x0)
by building up gradient information as the iterations proceed.</p>
<p>In the least squares problem there are further simplifications
which assist in solving eqn (2).  The function to be minimized is
a sum of squares:</p>
<blockquote>
<div>f = Sum(hi^2)                                         (3)</div></blockquote>
<p>where hi is the ith residual out of m residuals as described
above.  This can be substituted back into eqn (2) after computing
the derivatives:</p>
<blockquote>
<div>f&#8217;  = 2 Sum(hi  hi&#8217;)
f&#8217;&#8217; = 2 Sum(hi&#8217; hj&#8217;) + 2 Sum(hi hi&#8217;&#8216;)                (4)</div></blockquote>
<p>If one assumes that the parameters are already close enough to a
minimum, then one typically finds that the second term in f&#8217;&#8217; is
negligible [or, in any case, is too difficult to compute].  Thus,
equation (2) can be solved, at least approximately, using only
gradient information.</p>
<p>In matrix notation, the combination of eqns (2) and (4) becomes:</p>
<blockquote>
<div>hT&#8217; . h&#8217; . dx = - hT&#8217; . h                         (5)</div></blockquote>
<p>Where h is the residual vector (length m), hT is its transpose, h&#8217;
is the Jacobian matrix (dimensions n x m), and dx is (xm-x0).  The
user function supplies the residual vector h, and in some cases h&#8217;
when it is not found by finite differences (see MPFIT_FDJAC2,
which finds h and hT&#8217;).  Even if dx is not the best absolute step
to take, it does provide a good estimate of the best <em>direction</em>,
so often a line minimization will occur along the dx vector
direction.</p>
<p>The method of solution employed by MINPACK is to form the Q . R
factorization of h&#8217;, where Q is an orthogonal matrix such that QT .
Q = I, and R is upper right triangular.  Using h&#8217; = Q . R and the
ortogonality of Q, eqn (5) becomes</p>
<blockquote>
<div><dl class="docutils">
<dt>(RT . QT) . (Q . R) . dx = - (RT . QT) . h</dt>
<dd><dl class="first last docutils">
<dt>RT . R . dx = - RT . QT . h         (6)</dt>
<dd>R . dx = - QT . h</dd>
</dl>
</dd>
</dl>
</div></blockquote>
<p>where the last statement follows because R is upper triangular.
Here, R, QT and h are known so this is a matter of solving for dx.
The routine MPFIT_QRFAC provides the QR factorization of h, with
pivoting, and MPFIT_QRSOLV provides the solution for dx.</p>
<blockquote>
<div>REFERENCES</div></blockquote>
<p>MINPACK-1, Jorge More&#8217;, available from netlib (www.netlib.org).
&#8220;Optimization Software Guide,&#8221; Jorge More&#8217; and Stephen Wright,</p>
<blockquote>
<div>SIAM, <em>Frontiers in Applied Mathematics</em>, Number 14.</div></blockquote>
<dl class="docutils">
<dt>More&#8217;, Jorge J., &#8220;The Levenberg-Marquardt Algorithm:</dt>
<dd><p class="first">Implementation and Theory,&#8221; in <em>Numerical Analysis</em>, ed. Watson,
G. A., Lecture Notes in Mathematics 630, Springer-Verlag, 1977.</p>
<blockquote class="last">
<div>MODIFICATION HISTORY</div></blockquote>
</dd>
</dl>
<p>Translated from MINPACK-1 in FORTRAN, Apr-Jul 1998, CM</p>
</div></blockquote>
<p>Copyright (C) 1997-2002, Craig Markwardt
This software is provided as is without any warranty whatsoever.
Permission to use, copy, modify, and distribute modified or
unmodified copies is granted, provided this copyright and disclaimer
are included unchanged.</p>
<blockquote>
<div>Translated from MPFIT (Craig Markwardt&#8217;s IDL package) to Python,
August, 2002.  Mark Rivers
Converted from Numeric to numpy (Sergey Koposov, July 2008)</div></blockquote>
</div></blockquote>
<dl class="class">
<dt id="agpy.mpfit_custom.machar">
<em class="property">class </em><tt class="descclassname">agpy.mpfit_custom.</tt><tt class="descname">machar</tt><big>(</big><em>double=1</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#machar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.machar" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="agpy.mpfit_custom.mpfit">
<em class="property">class </em><tt class="descclassname">agpy.mpfit_custom.</tt><tt class="descname">mpfit</tt><big>(</big><em>fcn</em>, <em>xall=None</em>, <em>functkw={}</em>, <em>parinfo=None</em>, <em>ftol=1e-10</em>, <em>xtol=1e-10</em>, <em>gtol=1e-10</em>, <em>damp=0.0</em>, <em>maxiter=200</em>, <em>factor=100.0</em>, <em>nprint=1</em>, <em>iterfunct='default'</em>, <em>iterkw={}</em>, <em>nocovar=0</em>, <em>fastnorm=0</em>, <em>rescale=0</em>, <em>autoderivative=1</em>, <em>quiet=0</em>, <em>diag=None</em>, <em>epsfcn=None</em>, <em>debug=0</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit" title="Permalink to this definition">¶</a></dt>
<dd><dl class="method">
<dt id="agpy.mpfit_custom.mpfit.calc_covar">
<tt class="descname">calc_covar</tt><big>(</big><em>rr</em>, <em>ipvt=None</em>, <em>tol=1e-14</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.calc_covar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.calc_covar" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.call">
<tt class="descname">call</tt><big>(</big><em>fcn</em>, <em>x</em>, <em>functkw</em>, <em>fjac=None</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.call"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.call" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.defiter">
<tt class="descname">defiter</tt><big>(</big><em>fcn</em>, <em>x</em>, <em>iter</em>, <em>fnorm=None</em>, <em>functkw=None</em>, <em>quiet=0</em>, <em>iterstop=None</em>, <em>parinfo=None</em>, <em>format=None</em>, <em>pformat='%.10g'</em>, <em>dof=1</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.defiter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.defiter" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.enorm">
<tt class="descname">enorm</tt><big>(</big><em>vec</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.enorm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.enorm" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.fdjac2">
<tt class="descname">fdjac2</tt><big>(</big><em>fcn</em>, <em>x</em>, <em>fvec</em>, <em>step=None</em>, <em>ulimited=None</em>, <em>ulimit=None</em>, <em>dside=None</em>, <em>epsfcn=None</em>, <em>autoderivative=1</em>, <em>functkw=None</em>, <em>xall=None</em>, <em>ifree=None</em>, <em>dstep=None</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.fdjac2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.fdjac2" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.lmpar">
<tt class="descname">lmpar</tt><big>(</big><em>r</em>, <em>ipvt</em>, <em>diag</em>, <em>qtb</em>, <em>delta</em>, <em>x</em>, <em>sdiag</em>, <em>par=None</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.lmpar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.lmpar" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.parinfo">
<tt class="descname">parinfo</tt><big>(</big><em>parinfo=None</em>, <em>key='a'</em>, <em>default=None</em>, <em>n=0</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.parinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.parinfo" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.qrfac">
<tt class="descname">qrfac</tt><big>(</big><em>a</em>, <em>pivot=0</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.qrfac"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.qrfac" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.qrsolv">
<tt class="descname">qrsolv</tt><big>(</big><em>r</em>, <em>ipvt</em>, <em>diag</em>, <em>qtb</em>, <em>sdiag</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.qrsolv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.qrsolv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="agpy.mpfit_custom.mpfit.tie">
<tt class="descname">tie</tt><big>(</big><em>p</em>, <em>ptied=None</em><big>)</big><a class="reference internal" href="_modules/agpy/mpfit_custom.html#mpfit.tie"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.mpfit_custom.mpfit.tie" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-agpy.posang">
<span id="posang-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">posang</span></tt> Module<a class="headerlink" href="#module-agpy.posang" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.posang.posang">
<tt class="descclassname">agpy.posang.</tt><tt class="descname">posang</tt><big>(</big><em>l1</em>, <em>b1</em>, <em>l2</em>, <em>b2</em>, <em>system='galactic'</em>, <em>units='degrees'</em>, <em>**kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/posang.html#posang"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.posang.posang" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the position angle between two points assuming a rectilinear
coordinate system (I think; at the very least I am making no corrections
for wcs).</p>
<p>INPUT:
longitude1, latitude1, longitude2, latitude2</p>
<p>Defaults to GALACTIC coordinates.  <a href="#id6"><span class="problematic" id="id7">**</span></a>kwargs are passed to coords.Position</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.powerfit">
<span id="powerfit-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">powerfit</span></tt> Module<a class="headerlink" href="#module-agpy.powerfit" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.powerfit.brokenpowerfit">
<tt class="descclassname">agpy.powerfit.</tt><tt class="descname">brokenpowerfit</tt><big>(</big><em>xax</em>, <em>data</em>, <em>err=None</em>, <em>alphaguess1=0.0</em>, <em>alphaguess2=-2.0</em>, <em>scaleguess=1.0</em>, <em>breakpoint=None</em>, <em>quiet=True</em><big>)</big><a class="reference internal" href="_modules/agpy/powerfit.html#brokenpowerfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.powerfit.brokenpowerfit" title="Permalink to this definition">¶</a></dt>
<dd><p>Fit a broken power law (a line in log-space) to data as a function of x
differs from &#8216;plfit&#8217; because plfit fits a power law distribution, 
this code simply fits a power law</p>
<p>This is a lot more intricate than the simple power law fit, since it involves
fitting two power laws with different slopes</p>
<p>Parameters:
p[0] - scale
p[1] - breakpoint
p[2] - power 1 (xax &lt; breakpoint)
p[3] - power 2 (xax &gt;= breakpoint)</p>
<p>There are 5 parameters (NOT 4) returned because there are two scales that are <em>NOT</em>
independent</p>
<p>returns: scale1,scale2,breakpoint,alpha1,alpha2</p>
</dd></dl>

<dl class="function">
<dt id="agpy.powerfit.powerfit">
<tt class="descclassname">agpy.powerfit.</tt><tt class="descname">powerfit</tt><big>(</big><em>xax</em>, <em>data</em>, <em>err=None</em>, <em>alphaguess=-2.0</em>, <em>scaleguess=1.0</em>, <em>quiet=True</em><big>)</big><a class="reference internal" href="_modules/agpy/powerfit.html#powerfit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.powerfit.powerfit" title="Permalink to this definition">¶</a></dt>
<dd><p>Fit a power law (a line in log-space) to data as a function of x
differs from &#8216;plfit&#8217; because plfit fits a power law distribution, 
this code simply fits a power law</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.psf_fitter">
<span id="psf-fitter-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">psf_fitter</span></tt> Module<a class="headerlink" href="#module-agpy.psf_fitter" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.psf_fitter.airy">
<tt class="descclassname">agpy.psf_fitter.</tt><tt class="descname">airy</tt><big>(</big><em>inpars</em>, <em>circle=True</em>, <em>rotate=False</em>, <em>vheight=True</em>, <em>shape=None</em>, <em>fwhm=False</em><big>)</big><a class="reference internal" href="_modules/agpy/psf_fitter.html#airy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.psf_fitter.airy" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a 2d Airy <em>function</em> of the form:
x&#8217; = numpy.cos(rota) * x - numpy.sin(rota) * y
y&#8217; = numpy.sin(rota) * x + numpy.cos(rota) * y
(rota should be in degrees)
radius = sqrt( (x&#8217;-xcen)^2 + (y&#8217;-ycen)^2 )
g = b + a * 2.0*BesselJ1( radius ) / radius</p>
<blockquote>
<div>(with a correction for the divide-by-zero in the center)</div></blockquote>
<dl class="docutils">
<dt>inpars = [b,a,center_x,center_y,width_x,width_y,rota]</dt>
<dd>(b is background height, a is peak amplitude)</dd>
</dl>
<p>where x and y are the input parameters of the returned function,
and all other parameters are specified by this function</p>
<p>However, the above values are passed by list.  The list should be:
inpars = (height,amplitude,center_x,center_y,width_x,width_y,rota)</p>
<dl class="docutils">
<dt>You can choose to ignore / neglect some of the above input parameters </dt>
<dd><p class="first">unumpy.sing the following options:
circle=1 - default is a circular Airy Disk.  An elliptical Airy is</p>
<blockquote>
<div>possible, but probably not physically motivated (unless it&#8217;s
sampled onto a stretched grid?).</div></blockquote>
<dl class="last docutils">
<dt>rotate=0 - default allows rotation of the gaussian ellipse.  Can</dt>
<dd>remove last parameter by setting rotate=0</dd>
<dt>vheight=1 - default allows a variable height-above-zero, i.e. an</dt>
<dd>additive constant for the Airy function.  Can remove first
parameter by setting this to 0</dd>
<dt>shape=None - if shape is set (to a 2-parameter list) then returns</dt>
<dd>an image with the gaussian defined by inpars</dd>
</dl>
</dd>
<dt>fwhm - if set, assumes the Width parameters input are FWHM widths, so</dt>
<dd>they&#8217;ll be converted to &#8220;Sigma&#8221; widths by s = FWHM/2.0/1.61633
(<a class="reference external" href="http://en.wikipedia.org/wiki/Airy_disk">http://en.wikipedia.org/wiki/Airy_disk</a> 
and <a class="reference external" href="http://home.fnal.gov/~neilsen/notebook/astroPSF/astroPSF.html">http://home.fnal.gov/~neilsen/notebook/astroPSF/astroPSF.html</a>)</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="agpy.psf_fitter.psffit">
<tt class="descclassname">agpy.psf_fitter.</tt><tt class="descname">psffit</tt><big>(</big><em>data, err=None, params=[], autoderiv=True, return_all=False, circle=True, fixed=array([False, False, False, False, False, False, False], dtype=bool), limitedmin=[False, False, False, False, True, True, True], limitedmax=[False, False, False, False, False, False, True], usemoment=array([], dtype=bool), minpars=array([0, 0, 0, 0, 0, 0, 0]), maxpars=[0, 0, 0, 0, 0, 0, 360], rotate=0, vheight=1, quiet=True, returnmp=False, returnfitimage=False, psffunction=&lt;function airy at 0x10e39dc08&gt;, extra_pars=None, return_parinfo=False, **kwargs</em><big>)</big><a class="reference internal" href="_modules/agpy/psf_fitter.html#psffit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.psf_fitter.psffit" title="Permalink to this definition">¶</a></dt>
<dd><p>PSF fitter with the ability to fit a variety of different forms of
2-dimensional gaussian OR an Airy.
This code is mostly directly copied from gaussfitter.py and presents 
yet another argument for me turning this into a class...</p>
<dl class="docutils">
<dt>Input Parameters:</dt>
<dd><p class="first">data - 2-dimensional data array
err=None - error array with same size as data array
params=[] - initial input parameters for Gaussian function.</p>
<blockquote>
<div>(height, amplitude, x, y, width_x, width_y, rota)
if not input, these will be determined from the moments of the system, 
assuming no rotation</div></blockquote>
<dl class="docutils">
<dt>autoderiv=1 - use the autoderiv provided in the lmder.f function (the</dt>
<dd>alternative is to us an analytic derivative with lmdif.f: this method
is less robust)</dd>
<dt>return_all=0 - Default is to return only the Gaussian parameters.  </dt>
<dd>1 - fit params, fit error</dd>
</dl>
<p>returnfitimage - returns (best fit params,best fit image)
returnmp - returns the full mpfit struct
circle=0 - default is an elliptical gaussian (different x, y widths),</p>
<blockquote>
<div>but can reduce the input by one parameter if it&#8217;s a circular gaussian</div></blockquote>
<dl class="last docutils">
<dt>rotate=1 - default allows rotation of the gaussian ellipse.  Can remove</dt>
<dd>last parameter by setting rotate=0.  numpy.expects angle in DEGREES</dd>
<dt>vheight=1 - default allows a variable height-above-zero, i.e. an</dt>
<dd>additive constant for the Gaussian function.  Can remove first
parameter by setting this to 0</dd>
<dt>usemoment - can choose which parameters to use a moment estimation for.</dt>
<dd>Other parameters will be taken from params.  Needs to be a boolean
array.</dd>
<dt>extra_pars - If your psffunction requires extra parameters, pass their</dt>
<dd>parinfo dictionaries through this variable</dd>
</dl>
</dd>
<dt>Output:</dt>
<dd><dl class="first docutils">
<dt>Default output is a set of Gaussian parameters with the same shape as</dt>
<dd>the input parameters</dd>
<dt>Can also output the covariance matrix, &#8216;infodict&#8217; that contains a lot</dt>
<dd>more detail about the fit (see scipy.optimize.leastsq), and a message
from leastsq telling what the exit status of the fitting routine was</dd>
</dl>
<p class="last">Warning: Does NOT necessarily output a rotation angle between 0 and 360 degrees.</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-agpy.pstopng">
<span id="pstopng-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">pstopng</span></tt> Module<a class="headerlink" href="#module-agpy.pstopng" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-agpy.query_splatalogue">
<span id="query-splatalogue-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">query_splatalogue</span></tt> Module<a class="headerlink" href="#module-agpy.query_splatalogue" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.query_splatalogue.query_splatalogue">
<tt class="descclassname">agpy.query_splatalogue.</tt><tt class="descname">query_splatalogue</tt><big>(</big><em>minwav=0.0025999999999999999</em>, <em>maxwav=0.0026099999999999999</em>, <em>waveunits='m'</em>, <em>root_url='http://find.nrao.edu/splata-slap/slap'</em>, <em>chemical_element=None</em>, <em>NRAO_Recommended=True</em><big>)</big><a class="reference internal" href="_modules/agpy/query_splatalogue.html#query_splatalogue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.query_splatalogue.query_splatalogue" title="Permalink to this definition">¶</a></dt>
<dd><p>Acquire an atpy table of a splatalogue searched based on wavelength.</p>
<p>Future work will allow queries based on other parameters.  I&#8217;m waiting on
development by the SPLATASLAP database folks to implement these.</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.ratosexagesimal">
<span id="ratosexagesimal-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">ratosexagesimal</span></tt> Module<a class="headerlink" href="#module-agpy.ratosexagesimal" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.ratosexagesimal.dectos">
<tt class="descclassname">agpy.ratosexagesimal.</tt><tt class="descname">dectos</tt><big>(</big><em>dec</em><big>)</big><a class="reference internal" href="_modules/agpy/ratosexagesimal.html#dectos"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.ratosexagesimal.dectos" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.ratosexagesimal.ratos">
<tt class="descclassname">agpy.ratosexagesimal.</tt><tt class="descname">ratos</tt><big>(</big><em>ra</em><big>)</big><a class="reference internal" href="_modules/agpy/ratosexagesimal.html#ratos"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.ratosexagesimal.ratos" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.readcol">
<span id="readcol-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">readcol</span></tt> Module<a class="headerlink" href="#module-agpy.readcol" title="Permalink to this headline">¶</a></h2>
<p>readcol.py by Adam Ginsburg (<a class="reference external" href="mailto:keflavich&#37;&#52;&#48;gmail&#46;com">keflavich<span>&#64;</span>gmail<span>&#46;</span>com</a>)</p>
<p>readcol is meant to emulate IDL&#8217;s readcol.pro, but is more capable and
flexible.  It is not a particularly &#8220;pythonic&#8221; program since it is not modular.
For a modular ascii table reader, <a class="reference external" href="http://cxc.harvard.edu/contrib/asciitable/">http://cxc.harvard.edu/contrib/asciitable/</a> is
probably better.  This single-function code is probably more intuitive to an
end-user, though.</p>
<dl class="class">
<dt id="agpy.readcol.Struct">
<em class="property">class </em><tt class="descclassname">agpy.readcol.</tt><tt class="descname">Struct</tt><big>(</big><em>namedict</em><big>)</big><a class="reference internal" href="_modules/agpy/readcol.html#Struct"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.readcol.Struct" title="Permalink to this definition">¶</a></dt>
<dd><p>Simple struct intended to take a dictionary of column names -&gt; columns
and turn it into a struct by removing special characters</p>
<dl class="method">
<dt id="agpy.readcol.Struct.add_column">
<tt class="descname">add_column</tt><big>(</big><em>name</em>, <em>data</em><big>)</big><a class="reference internal" href="_modules/agpy/readcol.html#Struct.add_column"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.readcol.Struct.add_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a new column (attribute) to the struct
(will overwrite anything with the same name)</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="agpy.readcol.get_autotype">
<tt class="descclassname">agpy.readcol.</tt><tt class="descname">get_autotype</tt><big>(</big><em>arr</em><big>)</big><a class="reference internal" href="_modules/agpy/readcol.html#get_autotype"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.readcol.get_autotype" title="Permalink to this definition">¶</a></dt>
<dd><p>Attempts to return a numpy array converted to the most sensible dtype
Value errors will be caught and simply return the original array
Tries to make dtype int, then float, then no change</p>
</dd></dl>

<dl class="function">
<dt id="agpy.readcol.make_commentfilter">
<tt class="descclassname">agpy.readcol.</tt><tt class="descname">make_commentfilter</tt><big>(</big><em>comment</em><big>)</big><a class="reference internal" href="_modules/agpy/readcol.html#make_commentfilter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.readcol.make_commentfilter" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.readcol.readcol">
<tt class="descclassname">agpy.readcol.</tt><tt class="descname">readcol</tt><big>(</big><em>filename</em>, <em>skipline=0</em>, <em>skipafter=0</em>, <em>names=False</em>, <em>fsep=None</em>, <em>twod=True</em>, <em>fixedformat=None</em>, <em>asdict=False</em>, <em>comment='#'</em>, <em>verbose=True</em>, <em>nullval=None</em>, <em>asStruct=False</em>, <em>namecomment=True</em>, <em>removeblanks=False</em>, <em>header_badchars=None</em><big>)</big><a class="reference internal" href="_modules/agpy/readcol.html#readcol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.readcol.readcol" title="Permalink to this definition">¶</a></dt>
<dd><p>The default return is a two dimensional float array.  If you want a list of
columns output instead of a 2D array, pass &#8216;twod=False&#8217;.  In this case,
each column&#8217;s data type will be automatically detected.</p>
<p>Example usage:
CASE 1) a table has the format:</p>
<blockquote>
<div>X    Y    Z</div></blockquote>
<p>0.0  2.4  8.2
1.0  3.4  5.6
0.7  3.2  2.1
...
names,(x,y,z)=readcol(&#8220;myfile.tbl&#8221;,names=True,twod=False)
or
x,y,z=readcol(&#8220;myfile.tbl&#8221;,skipline=1,twod=False)
or 
names,xx = readcol(&#8220;myfile.tbl&#8221;,names=True)
or
xxdict = readcol(&#8220;myfile.tbl&#8221;,asdict=True)
or
xxstruct = readcol(&#8220;myfile.tbl&#8221;,asStruct=True)</p>
<p>CASE 2) no title is contained into the table, then there is
no need to skipline:
x,y,z=readcol(&#8220;myfile.tbl&#8221;)</p>
<dl class="docutils">
<dt>CASE 3) there is a names column and then more descriptive text:</dt>
<dd>X      Y     Z</dd>
</dl>
<p>(deg) (deg) (km/s) 
0.0    2.4   8.2
1.0    3.4.  5.6
...
then use:
names,x,y,z=readcol(&#8220;myfile.tbl&#8221;,names=True,skipline=1,twod=False)
or
x,y,z=readcol(&#8220;myfile.tbl&#8221;,skipline=2,twod=False)</p>
<dl class="docutils">
<dt>INPUTS:</dt>
<dd><p class="first">fsep - field separator, e.g. for comma separated value (csv) files
skipline - number of lines to ignore at the start of the file
names - read / don&#8217;t read in the first line as a list of column names</p>
<blockquote>
<div>can specify an integer line number too, though it will be 
the line number after skipping lines</div></blockquote>
<p>twod - two dimensional or one dimensional output
nullval - if specified, all instances of this value will be replaced</p>
<blockquote>
<div>with a floating NaN</div></blockquote>
<dl class="last docutils">
<dt>asdict - zips names with data to create a dict with column headings </dt>
<dd>tied to column data.  If asdict=True, names will be set to True</dd>
<dt>asStruct - same as asdict, but returns a structure instead of a dictionary</dt>
<dd>(i.e. you call struct.key instead of struct[&#8216;key&#8217;])</dd>
<dt>fixedformat - if you have a fixed format file, this is a python list of </dt>
<dd>column lengths.  e.g. the first table above would be [3,5,5].  Note
that if you specify the wrong fixed format, you will get junk; if your
format total is greater than the line length, the last entries will all
be blank but readcol will not report an error.</dd>
<dt>namecomment - assumed that &#8220;Name&#8221; row is on a comment line.  If it is not - </dt>
<dd>e.g., it is the first non-comment line, change this to False</dd>
<dt>removeblanks - remove all blank entries from split lines.  This can cause lost</dt>
<dd>data if you have blank entries on some lines.</dd>
<dt>header_badchars - remove these characters from a header before parsing it</dt>
<dd>(helpful for IPAC tables that are delimited with | )</dd>
</dl>
</dd>
</dl>
<p>If you get this error: &#8220;scipy could not be imported.  Your table must have
full rows.&#8221; it means readcol cannot automatically guess which columns
contain data.  If you have scipy and columns of varying length, readcol will
read in all of the rows with length=mode(row lengths).</p>
</dd></dl>

<dl class="function">
<dt id="agpy.readcol.readff">
<tt class="descclassname">agpy.readcol.</tt><tt class="descname">readff</tt><big>(</big><em>s</em>, <em>format</em><big>)</big><a class="reference internal" href="_modules/agpy/readcol.html#readff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.readcol.readff" title="Permalink to this definition">¶</a></dt>
<dd><p>Fixed-format reader
Pass in a single line string (s) and a format list, 
which needs to be a python list of string lengths</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.reg_gal2cel">
<span id="reg-gal2cel-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">reg_gal2cel</span></tt> Module<a class="headerlink" href="#module-agpy.reg_gal2cel" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.reg_gal2cel.gal2cel">
<tt class="descclassname">agpy.reg_gal2cel.</tt><tt class="descname">gal2cel</tt><big>(</big><em>regfile</em><big>)</big><a class="reference internal" href="_modules/agpy/reg_gal2cel.html#gal2cel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.reg_gal2cel.gal2cel" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a region file from galactic to celestial coordinates including
position angle reference from the center of the box (right now only works
on box regions)</p>
<p>Requires pyregion with the ShapeList.write() function implemented...
not clear if that exists in 1.0</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.regfile_aperture_extract">
<span id="regfile-aperture-extract-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">regfile_aperture_extract</span></tt> Module<a class="headerlink" href="#module-agpy.regfile_aperture_extract" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.regfile_aperture_extract.get_fluxes">
<tt class="descclassname">agpy.regfile_aperture_extract.</tt><tt class="descname">get_fluxes</tt><big>(</big><em>regfile</em>, <em>outfile</em>, <em>inneraprad=35</em>, <em>outeraprad=60</em>, <em>hdu=None</em>, <em>PPBEAM=1.0</em>, <em>debug=False</em>, <em>print_nulls=False</em><big>)</big><a class="reference internal" href="_modules/agpy/regfile_aperture_extract.html#get_fluxes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.regfile_aperture_extract.get_fluxes" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract fluxes from a region-defined aperture with inner and outer circular apertures
specififed</p>
<p>MUST BE IN GALACTIC COORDINATES</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.region_photometry">
<span id="region-photometry-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">region_photometry</span></tt> Module<a class="headerlink" href="#module-agpy.region_photometry" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.region_photometry.region_photometry">
<tt class="descclassname">agpy.region_photometry.</tt><tt class="descname">region_photometry</tt><big>(</big><em>regionfile</em>, <em>fitsfilename</em>, <em>outfile='/dev/tty'</em>, <em>doprint=True</em><big>)</big><a class="reference internal" href="_modules/agpy/region_photometry.html#region_photometry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.region_photometry.region_photometry" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.region_photometry_files">
<span id="region-photometry-files-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">region_photometry_files</span></tt> Module<a class="headerlink" href="#module-agpy.region_photometry_files" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.region_photometry_files.region_photometry_files">
<tt class="descclassname">agpy.region_photometry_files.</tt><tt class="descname">region_photometry_files</tt><big>(</big><em>regfile</em>, <em>filelist</em><big>)</big><a class="reference internal" href="_modules/agpy/region_photometry_files.html#region_photometry_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.region_photometry_files.region_photometry_files" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.region_positions">
<span id="region-positions-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">region_positions</span></tt> Module<a class="headerlink" href="#module-agpy.region_positions" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.region_positions.coords_format">
<tt class="descclassname">agpy.region_positions.</tt><tt class="descname">coords_format</tt><big>(</big><em>format</em><big>)</big><a class="reference internal" href="_modules/agpy/region_positions.html#coords_format"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.region_positions.coords_format" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from ds9&#8217;s &#8216;fk5&#8217; and &#8216;icrs&#8217; naming convention to the
&#8216;celestial&#8217;/&#8217;galactic&#8217; used by coords</p>
</dd></dl>

<dl class="function">
<dt id="agpy.region_positions.pos_to_name">
<tt class="descclassname">agpy.region_positions.</tt><tt class="descname">pos_to_name</tt><big>(</big><em>reg</em><big>)</big><a class="reference internal" href="_modules/agpy/region_positions.html#pos_to_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.region_positions.pos_to_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a region, returns a name based on Galactic coordinates</p>
</dd></dl>

<dl class="function">
<dt id="agpy.region_positions.position_region">
<tt class="descclassname">agpy.region_positions.</tt><tt class="descname">position_region</tt><big>(</big><em>reg</em><big>)</big><a class="reference internal" href="_modules/agpy/region_positions.html#position_region"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.region_positions.position_region" title="Permalink to this definition">¶</a></dt>
<dd><p>small wrapper to get a Position object using the correct coordinate system</p>
<p>reg must by a pyregion Shape instance</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.regtoapo">
<span id="regtoapo-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">regtoapo</span></tt> Module<a class="headerlink" href="#module-agpy.regtoapo" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.regtoapo.regtoapo">
<tt class="descclassname">agpy.regtoapo.</tt><tt class="descname">regtoapo</tt><big>(</big><em>regfile</em>, <em>outfile</em>, <em>filtercolor=None</em><big>)</big><a class="reference internal" href="_modules/agpy/regtoapo.html#regtoapo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.regtoapo.regtoapo" title="Permalink to this definition">¶</a></dt>
<dd><p>Take an input ds9 .reg file and create an output file
formatted to work with APO&#8217;s TUI</p>
<p>filtercolor - if specified, will ignore any regions of this color</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.regtocima">
<span id="regtocima-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">regtocima</span></tt> Module<a class="headerlink" href="#module-agpy.regtocima" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.regtocima.regtocima">
<tt class="descclassname">agpy.regtocima.</tt><tt class="descname">regtocima</tt><big>(</big><em>regfile</em>, <em>outfile</em>, <em>filtercolor=None</em><big>)</big><a class="reference internal" href="_modules/agpy/regtocima.html#regtocima"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.regtocima.regtocima" title="Permalink to this definition">¶</a></dt>
<dd><p>Take an input ds9 .reg file and create an output file
formatted to work with Arecibo&#8217;s CIMA
[NOT FUNCTIONAL]</p>
<p>filtercolor - if specified, will ignore any regions of this color</p>
</dd></dl>

<dl class="function">
<dt id="agpy.regtocima.regtouptime">
<tt class="descclassname">agpy.regtocima.</tt><tt class="descname">regtouptime</tt><big>(</big><em>regfile</em>, <em>outfile</em>, <em>maxza=15.0</em><big>)</big><a class="reference internal" href="_modules/agpy/regtocima.html#regtouptime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.regtocima.regtouptime" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a region file to a list of target names + how long they are observable &#64; arecibo</p>
<p>maxza = 15.0 degrees for &#8220;broken&#8221; Arecibo (2010) or 18-19 for normal Arecibo</p>
</dd></dl>

</div>
<div class="section" id="module-agpy.subim_gaussfit">
<span id="subim-gaussfit-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">subim_gaussfit</span></tt> Module<a class="headerlink" href="#module-agpy.subim_gaussfit" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.subim_gaussfit.fitstar">
<tt class="descclassname">agpy.subim_gaussfit.</tt><tt class="descname">fitstar</tt><big>(</big><em>filename</em>, <em>x_cen</em>, <em>y_cen</em>, <em>errname=</em><span class="optional">[</span><span class="optional">]</span><big>)</big><a class="reference internal" href="_modules/agpy/subim_gaussfit.html#fitstar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.subim_gaussfit.fitstar" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.subim_gaussfit.fitstars">
<tt class="descclassname">agpy.subim_gaussfit.</tt><tt class="descname">fitstars</tt><big>(</big><em>filelist</em>, <em>x_cen</em>, <em>y_cen</em><big>)</big><a class="reference internal" href="_modules/agpy/subim_gaussfit.html#fitstars"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.subim_gaussfit.fitstars" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="agpy.subim_gaussfit.printfits">
<tt class="descclassname">agpy.subim_gaussfit.</tt><tt class="descname">printfits</tt><big>(</big><em>outfilename</em>, <em>filelist</em>, <em>xcen</em>, <em>ycen</em><big>)</big><a class="reference internal" href="_modules/agpy/subim_gaussfit.html#printfits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.subim_gaussfit.printfits" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="module-agpy.timer">
<span id="timer-module"></span><h2><tt class="xref py py-mod docutils literal"><span class="pre">timer</span></tt> Module<a class="headerlink" href="#module-agpy.timer" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="agpy.timer.print_timing">
<tt class="descclassname">agpy.timer.</tt><tt class="descname">print_timing</tt><big>(</big><em>func</em><big>)</big><a class="reference internal" href="_modules/agpy/timer.html#print_timing"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#agpy.timer.print_timing" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Contents:
.. toctree:</p>
<div class="highlight-python"><pre>:maxdepth: 3
gaussfit
uchii
pyflagger
contributed</pre>
</div>
</div>
</div>


          </div>
        </div>
      </div>
        </div>
        <div class="sidebar">
          <h3>Table Of Contents</h3>
          <ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="">Adam Ginsburg&#8217;s Python Code (agpy)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#agpy-package"><tt class="docutils literal"><span class="pre">agpy</span></tt> Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.PCA_tools"><tt class="docutils literal"><span class="pre">PCA_tools</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.asinh_norm"><tt class="docutils literal"><span class="pre">asinh_norm</span></tt> Module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#arcsinh-colorbar-normalization">Arcsinh Colorbar Normalization</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.blackbody"><tt class="docutils literal"><span class="pre">blackbody</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.collapse_gaussfit"><tt class="docutils literal"><span class="pre">collapse_gaussfit</span></tt> Module</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#collapse-gaussfit">Collapse Gaussfit</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.constants"><tt class="docutils literal"><span class="pre">constants</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.conversationcount"><tt class="docutils literal"><span class="pre">conversationcount</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.cubes"><tt class="docutils literal"><span class="pre">cubes</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.cutout"><tt class="docutils literal"><span class="pre">cutout</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.densitymap"><tt class="docutils literal"><span class="pre">densitymap</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.ds9_phot"><tt class="docutils literal"><span class="pre">ds9_phot</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.dust"><tt class="docutils literal"><span class="pre">dust</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.gaussfitter"><tt class="docutils literal"><span class="pre">gaussfitter</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.get_cutouts"><tt class="docutils literal"><span class="pre">get_cutouts</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.grep"><tt class="docutils literal"><span class="pre">grep</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.h2fit"><tt class="docutils literal"><span class="pre">h2fit</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.hotwind"><tt class="docutils literal"><span class="pre">hotwind</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.imf"><tt class="docutils literal"><span class="pre">imf</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.kdist"><tt class="docutils literal"><span class="pre">kdist</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.lagrange_diff"><tt class="docutils literal"><span class="pre">lagrange_diff</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.luminosity"><tt class="docutils literal"><span class="pre">luminosity</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.mad"><tt class="docutils literal"><span class="pre">mad</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.mpfit_custom"><tt class="docutils literal"><span class="pre">mpfit_custom</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.posang"><tt class="docutils literal"><span class="pre">posang</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.powerfit"><tt class="docutils literal"><span class="pre">powerfit</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.psf_fitter"><tt class="docutils literal"><span class="pre">psf_fitter</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.pstopng"><tt class="docutils literal"><span class="pre">pstopng</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.query_splatalogue"><tt class="docutils literal"><span class="pre">query_splatalogue</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.ratosexagesimal"><tt class="docutils literal"><span class="pre">ratosexagesimal</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.readcol"><tt class="docutils literal"><span class="pre">readcol</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.reg_gal2cel"><tt class="docutils literal"><span class="pre">reg_gal2cel</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.regfile_aperture_extract"><tt class="docutils literal"><span class="pre">regfile_aperture_extract</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.region_photometry"><tt class="docutils literal"><span class="pre">region_photometry</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.region_photometry_files"><tt class="docutils literal"><span class="pre">region_photometry_files</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.region_positions"><tt class="docutils literal"><span class="pre">region_positions</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.regtoapo"><tt class="docutils literal"><span class="pre">regtoapo</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.regtocima"><tt class="docutils literal"><span class="pre">regtocima</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.subim_gaussfit"><tt class="docutils literal"><span class="pre">subim_gaussfit</span></tt> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-agpy.timer"><tt class="docutils literal"><span class="pre">timer</span></tt> Module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="image_tools.html">Image Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="fft_tools.html">AG_fft_tools Package</a></li>
<li class="toctree-l1"><a class="reference internal" href="plfit.html">plfit Package</a></li>
</ul>

          <h3 style="margin-top: 1.5em;">Search</h3>
          <form class="search" action="search.html" method="get">
            <input type="text" name="q" />
            <input type="submit" value="Go" />
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>
          <p class="searchtip" style="font-size: 90%">
            Enter search terms or a module, class or function name.
          </p>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

    <div class="footer">
      &copy; Copyright 2011, Adam Ginsburg.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2pre.
    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-6253248-2']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    </script>
        
    </div>
  </body>
</html>